30 changed files with 2122 additions and 11 deletions
@ -0,0 +1,32 @@ |
|||||
|
<?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"> |
||||
|
<parent> |
||||
|
<artifactId>epdc-group</artifactId> |
||||
|
<groupId>com.esua.epdc</groupId> |
||||
|
<version>1.0.0</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>epdc-group-client</artifactId> |
||||
|
<packaging>jar</packaging> |
||||
|
|
||||
|
<dependencies> |
||||
|
<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-admin-client</artifactId> |
||||
|
<version>1.0.0</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.esua.epdc</groupId> |
||||
|
<artifactId>epdc-news-client</artifactId> |
||||
|
<version>1.0.0</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
</project> |
||||
@ -0,0 +1,141 @@ |
|||||
|
/** |
||||
|
* 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.dto.group; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 社群表 社群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GroupDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 社群名称 |
||||
|
*/ |
||||
|
private String groupName; |
||||
|
|
||||
|
/** |
||||
|
* 社群头像 |
||||
|
*/ |
||||
|
private String groupAvatar; |
||||
|
|
||||
|
/** |
||||
|
* 社群介绍 |
||||
|
*/ |
||||
|
private String groupIntroduction; |
||||
|
|
||||
|
/** |
||||
|
* 社群类别 0:党员群,1:自建群 |
||||
|
*/ |
||||
|
private String groupCategory; |
||||
|
|
||||
|
/** |
||||
|
* 区 |
||||
|
*/ |
||||
|
private String area; |
||||
|
|
||||
|
/** |
||||
|
* 区ID |
||||
|
*/ |
||||
|
private String areaId; |
||||
|
|
||||
|
/** |
||||
|
* 街道 |
||||
|
*/ |
||||
|
private String street; |
||||
|
|
||||
|
/** |
||||
|
* 街道ID |
||||
|
*/ |
||||
|
private String streetId; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String community; |
||||
|
|
||||
|
/** |
||||
|
* 社区ID |
||||
|
*/ |
||||
|
private String communityId; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String grid; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 状态 0:待审核,5:审核不通过,10:审核通过,15:禁言,20:已解散 |
||||
|
*/ |
||||
|
private Integer state; |
||||
|
|
||||
|
/** |
||||
|
* 处理意见 |
||||
|
*/ |
||||
|
private String processingOpinions; |
||||
|
|
||||
|
/** |
||||
|
* 删除标记 0:未删除,1:已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,187 @@ |
|||||
|
/** |
||||
|
* 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.dto.topic; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 话题表 话题表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TopicDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 用户昵称 |
||||
|
*/ |
||||
|
private String nickname; |
||||
|
|
||||
|
/** |
||||
|
* 用户头像 |
||||
|
*/ |
||||
|
private String userFace; |
||||
|
|
||||
|
/** |
||||
|
* 党员标识 0:否,1:是 |
||||
|
*/ |
||||
|
private String partyMember; |
||||
|
|
||||
|
/** |
||||
|
* 话题内容 |
||||
|
*/ |
||||
|
private String topicContent; |
||||
|
|
||||
|
/** |
||||
|
* 议题ID |
||||
|
*/ |
||||
|
private String issueId; |
||||
|
|
||||
|
/** |
||||
|
* 项目ID |
||||
|
*/ |
||||
|
private String itemId; |
||||
|
|
||||
|
/** |
||||
|
* 区 |
||||
|
*/ |
||||
|
private String area; |
||||
|
|
||||
|
/** |
||||
|
* 区ID |
||||
|
*/ |
||||
|
private Long areaId; |
||||
|
|
||||
|
/** |
||||
|
* 街道 |
||||
|
*/ |
||||
|
private String street; |
||||
|
|
||||
|
/** |
||||
|
* 街道ID |
||||
|
*/ |
||||
|
private Long streetId; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String community; |
||||
|
|
||||
|
/** |
||||
|
* 社区ID |
||||
|
*/ |
||||
|
private Long communityId; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String grid; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private Long gridId; |
||||
|
|
||||
|
/** |
||||
|
* 话题地址 |
||||
|
*/ |
||||
|
private String topicAddress; |
||||
|
|
||||
|
/** |
||||
|
* 话题位置纬度 |
||||
|
*/ |
||||
|
private BigDecimal topicLatitude; |
||||
|
|
||||
|
/** |
||||
|
* 话题位置经度 |
||||
|
*/ |
||||
|
private BigDecimal topicLongitude; |
||||
|
|
||||
|
/** |
||||
|
* 友邻社群 |
||||
|
*/ |
||||
|
private String groupName; |
||||
|
|
||||
|
/** |
||||
|
* 友邻社群ID |
||||
|
*/ |
||||
|
private String groupId; |
||||
|
|
||||
|
/** |
||||
|
* 状态 0:讨论中,5:转议题待审核,10:转议题审核不通过,15:已转议题,20:已转项目,25:已关闭 |
||||
|
*/ |
||||
|
private Integer state; |
||||
|
|
||||
|
/** |
||||
|
* 评论数 |
||||
|
*/ |
||||
|
private Integer commentNum; |
||||
|
|
||||
|
/** |
||||
|
* 浏览数 |
||||
|
*/ |
||||
|
private Integer browseNum; |
||||
|
|
||||
|
/** |
||||
|
* 删除标记 0:未删除,1:已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,177 @@ |
|||||
|
<?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"> |
||||
|
<parent> |
||||
|
<artifactId>epdc-group</artifactId> |
||||
|
<groupId>com.esua.epdc</groupId> |
||||
|
<version>1.0.0</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>epdc-group-server</artifactId> |
||||
|
<packaging>jar</packaging> |
||||
|
|
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>com.esua.epdc</groupId> |
||||
|
<artifactId>epdc-group-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>com.alibaba.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>de.codecentric</groupId> |
||||
|
<artifactId>spring-boot-admin-starter-client</artifactId> |
||||
|
<version>${spring.boot.admin.version}</version> |
||||
|
</dependency> |
||||
|
<!-- 替换Feign原生httpclient --> |
||||
|
<dependency> |
||||
|
<groupId>io.github.openfeign</groupId> |
||||
|
<artifactId>feign-httpclient</artifactId> |
||||
|
<version>10.3.0</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>com.spotify</groupId> |
||||
|
<artifactId>docker-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>9064</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> |
||||
|
|
||||
|
<spring.datasource.druid.url> |
||||
|
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> |
||||
|
</spring.datasource.druid.url> |
||||
|
<spring.datasource.druid.username>epdc</spring.datasource.druid.username> |
||||
|
<spring.datasource.druid.password>elink833066</spring.datasource.druid.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>9064</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> |
||||
|
|
||||
|
<spring.datasource.druid.url> |
||||
|
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> |
||||
|
</spring.datasource.druid.url> |
||||
|
<spring.datasource.druid.username>epdc</spring.datasource.druid.username> |
||||
|
<spring.datasource.druid.password>elink833066</spring.datasource.druid.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>9064</server.port> |
||||
|
|
||||
|
<!-- redis配置 --> |
||||
|
<spring.redis.index>8</spring.redis.index> |
||||
|
<spring.redis.host>121.42.149.50</spring.redis.host> |
||||
|
<spring.redis.port>9001</spring.redis.port> |
||||
|
<spring.redis.password>elink888</spring.redis.password> |
||||
|
|
||||
|
<spring.datasource.druid.url> |
||||
|
<![CDATA[jdbc:mysql://121.42.29.81:3306/esua_epdc_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> |
||||
|
</spring.datasource.druid.url> |
||||
|
<spring.datasource.druid.username>epdc</spring.datasource.druid.username> |
||||
|
<spring.datasource.druid.password>elink833066</spring.datasource.druid.password> |
||||
|
<!-- nacos --> |
||||
|
<nacos.register-enabled>true</nacos.register-enabled> |
||||
|
<nacos.server-addr>172.31.171.61:9300</nacos.server-addr> |
||||
|
</properties> |
||||
|
</profile> |
||||
|
</profiles> |
||||
|
|
||||
|
</project> |
||||
@ -0,0 +1,21 @@ |
|||||
|
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.1.0 |
||||
|
*/ |
||||
|
@SpringBootApplication |
||||
|
@EnableDiscoveryClient |
||||
|
@EnableFeignClients |
||||
|
public class GroupApplication { |
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(GroupApplication.class, args); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
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 "group"; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,94 @@ |
|||||
|
/** |
||||
|
* 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.group.controller; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.elink.esua.epdc.dto.group.GroupDTO; |
||||
|
import com.elink.esua.epdc.modules.group.excel.GroupExcel; |
||||
|
import com.elink.esua.epdc.modules.group.service.GroupService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 社群表 社群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("group") |
||||
|
public class GroupController { |
||||
|
|
||||
|
@Autowired |
||||
|
private GroupService groupService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<GroupDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<GroupDTO> page = groupService.page(params); |
||||
|
return new Result<PageData<GroupDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<GroupDTO> get(@PathVariable("id") String id){ |
||||
|
GroupDTO data = groupService.get(id); |
||||
|
return new Result<GroupDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody GroupDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
groupService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody GroupDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
groupService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
groupService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<GroupDTO> list = groupService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, GroupExcel.class); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
/** |
||||
|
* 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.group.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.modules.group.entity.GroupEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 社群表 社群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface GroupDao extends BaseDao<GroupEntity> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,111 @@ |
|||||
|
/** |
||||
|
* 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.group.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 社群表 社群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("epdc_group") |
||||
|
public class GroupEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 社群名称 |
||||
|
*/ |
||||
|
private String groupName; |
||||
|
|
||||
|
/** |
||||
|
* 社群头像 |
||||
|
*/ |
||||
|
private String groupAvatar; |
||||
|
|
||||
|
/** |
||||
|
* 社群介绍 |
||||
|
*/ |
||||
|
private String groupIntroduction; |
||||
|
|
||||
|
/** |
||||
|
* 社群类别 0:党员群,1:自建群 |
||||
|
*/ |
||||
|
private String groupCategory; |
||||
|
|
||||
|
/** |
||||
|
* 区 |
||||
|
*/ |
||||
|
private String area; |
||||
|
|
||||
|
/** |
||||
|
* 区ID |
||||
|
*/ |
||||
|
private String areaId; |
||||
|
|
||||
|
/** |
||||
|
* 街道 |
||||
|
*/ |
||||
|
private String street; |
||||
|
|
||||
|
/** |
||||
|
* 街道ID |
||||
|
*/ |
||||
|
private String streetId; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String community; |
||||
|
|
||||
|
/** |
||||
|
* 社区ID |
||||
|
*/ |
||||
|
private String communityId; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String grid; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 状态 0:待审核,5:审核不通过,10:审核通过,15:禁言,20:已解散 |
||||
|
*/ |
||||
|
private Integer state; |
||||
|
|
||||
|
/** |
||||
|
* 处理意见 |
||||
|
*/ |
||||
|
private String processingOpinions; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,98 @@ |
|||||
|
/** |
||||
|
* 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.group.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 社群表 社群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GroupExcel { |
||||
|
|
||||
|
@Excel(name = "主键") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "社群名称") |
||||
|
private String groupName; |
||||
|
|
||||
|
@Excel(name = "社群头像") |
||||
|
private String groupAvatar; |
||||
|
|
||||
|
@Excel(name = "社群介绍") |
||||
|
private String groupIntroduction; |
||||
|
|
||||
|
@Excel(name = "社群类别 0:党员群,1:自建群") |
||||
|
private String groupCategory; |
||||
|
|
||||
|
@Excel(name = "区") |
||||
|
private String area; |
||||
|
|
||||
|
@Excel(name = "区ID") |
||||
|
private String areaId; |
||||
|
|
||||
|
@Excel(name = "街道") |
||||
|
private String street; |
||||
|
|
||||
|
@Excel(name = "街道ID") |
||||
|
private String streetId; |
||||
|
|
||||
|
@Excel(name = "社区") |
||||
|
private String community; |
||||
|
|
||||
|
@Excel(name = "社区ID") |
||||
|
private String communityId; |
||||
|
|
||||
|
@Excel(name = "网格") |
||||
|
private String grid; |
||||
|
|
||||
|
@Excel(name = "网格ID") |
||||
|
private String gridId; |
||||
|
|
||||
|
@Excel(name = "状态 0:待审核,5:审核不通过,10:审核通过,15:禁言,20:已解散") |
||||
|
private Integer state; |
||||
|
|
||||
|
@Excel(name = "处理意见") |
||||
|
private String processingOpinions; |
||||
|
|
||||
|
@Excel(name = "删除标记 0:未删除,1:已删除") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* 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.group.redis; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 社群表 社群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class GroupRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,95 @@ |
|||||
|
/** |
||||
|
* 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.group.service; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.dto.group.GroupDTO; |
||||
|
import com.elink.esua.epdc.modules.group.entity.GroupEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 社群表 社群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
public interface GroupService extends BaseService<GroupEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<GroupDTO> |
||||
|
* @author generator |
||||
|
* @date 2019-10-10 |
||||
|
*/ |
||||
|
PageData<GroupDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<GroupDTO> |
||||
|
* @author generator |
||||
|
* @date 2019-10-10 |
||||
|
*/ |
||||
|
List<GroupDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return GroupDTO |
||||
|
* @author generator |
||||
|
* @date 2019-10-10 |
||||
|
*/ |
||||
|
GroupDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-10-10 |
||||
|
*/ |
||||
|
void save(GroupDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-10-10 |
||||
|
*/ |
||||
|
void update(GroupDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-10-10 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
||||
@ -0,0 +1,104 @@ |
|||||
|
/** |
||||
|
* 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.group.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
||||
|
import com.elink.esua.epdc.dto.group.GroupDTO; |
||||
|
import com.elink.esua.epdc.modules.group.dao.GroupDao; |
||||
|
import com.elink.esua.epdc.modules.group.entity.GroupEntity; |
||||
|
import com.elink.esua.epdc.modules.group.redis.GroupRedis; |
||||
|
import com.elink.esua.epdc.modules.group.service.GroupService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 社群表 社群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class GroupServiceImpl extends BaseServiceImpl<GroupDao, GroupEntity> implements GroupService { |
||||
|
|
||||
|
@Autowired |
||||
|
private GroupRedis groupRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<GroupDTO> page(Map<String, Object> params) { |
||||
|
IPage<GroupEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, GroupDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<GroupDTO> list(Map<String, Object> params) { |
||||
|
List<GroupEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, GroupDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<GroupEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<GroupEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public GroupDTO get(String id) { |
||||
|
GroupEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, GroupDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(GroupDTO dto) { |
||||
|
GroupEntity entity = ConvertUtils.sourceToTarget(dto, GroupEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(GroupDTO dto) { |
||||
|
GroupEntity entity = ConvertUtils.sourceToTarget(dto, GroupEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,94 @@ |
|||||
|
/** |
||||
|
* 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.ExcelUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.elink.esua.epdc.dto.topic.TopicDTO; |
||||
|
import com.elink.esua.epdc.modules.topic.excel.TopicExcel; |
||||
|
import com.elink.esua.epdc.modules.topic.service.TopicService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
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; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<TopicDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<TopicDTO> page = topicService.page(params); |
||||
|
return new Result<PageData<TopicDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<TopicDTO> get(@PathVariable("id") String id){ |
||||
|
TopicDTO data = topicService.get(id); |
||||
|
return new Result<TopicDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody TopicDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
topicService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody TopicDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
topicService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
topicService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<TopicDTO> list = topicService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, TopicExcel.class); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
/** |
||||
|
* 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.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.modules.topic.entity.TopicEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 话题表 话题表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface TopicDao extends BaseDao<TopicEntity> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,157 @@ |
|||||
|
/** |
||||
|
* 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.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 话题表 话题表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("epdc_topic") |
||||
|
public class TopicEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 用户昵称 |
||||
|
*/ |
||||
|
private String nickname; |
||||
|
|
||||
|
/** |
||||
|
* 用户头像 |
||||
|
*/ |
||||
|
private String userFace; |
||||
|
|
||||
|
/** |
||||
|
* 党员标识 0:否,1:是 |
||||
|
*/ |
||||
|
private String partyMember; |
||||
|
|
||||
|
/** |
||||
|
* 话题内容 |
||||
|
*/ |
||||
|
private String topicContent; |
||||
|
|
||||
|
/** |
||||
|
* 议题ID |
||||
|
*/ |
||||
|
private String issueId; |
||||
|
|
||||
|
/** |
||||
|
* 项目ID |
||||
|
*/ |
||||
|
private String itemId; |
||||
|
|
||||
|
/** |
||||
|
* 区 |
||||
|
*/ |
||||
|
private String area; |
||||
|
|
||||
|
/** |
||||
|
* 区ID |
||||
|
*/ |
||||
|
private Long areaId; |
||||
|
|
||||
|
/** |
||||
|
* 街道 |
||||
|
*/ |
||||
|
private String street; |
||||
|
|
||||
|
/** |
||||
|
* 街道ID |
||||
|
*/ |
||||
|
private Long streetId; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String community; |
||||
|
|
||||
|
/** |
||||
|
* 社区ID |
||||
|
*/ |
||||
|
private Long communityId; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String grid; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private Long gridId; |
||||
|
|
||||
|
/** |
||||
|
* 话题地址 |
||||
|
*/ |
||||
|
private String topicAddress; |
||||
|
|
||||
|
/** |
||||
|
* 话题位置纬度 |
||||
|
*/ |
||||
|
private BigDecimal topicLatitude; |
||||
|
|
||||
|
/** |
||||
|
* 话题位置经度 |
||||
|
*/ |
||||
|
private BigDecimal topicLongitude; |
||||
|
|
||||
|
/** |
||||
|
* 友邻社群 |
||||
|
*/ |
||||
|
private String groupName; |
||||
|
|
||||
|
/** |
||||
|
* 友邻社群ID |
||||
|
*/ |
||||
|
private String groupId; |
||||
|
|
||||
|
/** |
||||
|
* 状态 0:讨论中,5:转议题待审核,10:转议题审核不通过,15:已转议题,20:已转项目,25:已关闭 |
||||
|
*/ |
||||
|
private Integer state; |
||||
|
|
||||
|
/** |
||||
|
* 评论数 |
||||
|
*/ |
||||
|
private Integer commentNum; |
||||
|
|
||||
|
/** |
||||
|
* 浏览数 |
||||
|
*/ |
||||
|
private Integer browseNum; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,126 @@ |
|||||
|
/** |
||||
|
* 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.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 话题表 话题表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TopicExcel { |
||||
|
|
||||
|
@Excel(name = "主键") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "用户ID") |
||||
|
private String userId; |
||||
|
|
||||
|
@Excel(name = "用户昵称") |
||||
|
private String nickname; |
||||
|
|
||||
|
@Excel(name = "用户头像") |
||||
|
private String userFace; |
||||
|
|
||||
|
@Excel(name = "党员标识 0:否,1:是") |
||||
|
private String partyMember; |
||||
|
|
||||
|
@Excel(name = "话题内容") |
||||
|
private String topicContent; |
||||
|
|
||||
|
@Excel(name = "议题ID") |
||||
|
private String issueId; |
||||
|
|
||||
|
@Excel(name = "项目ID") |
||||
|
private String itemId; |
||||
|
|
||||
|
@Excel(name = "区") |
||||
|
private String area; |
||||
|
|
||||
|
@Excel(name = "区ID") |
||||
|
private Long areaId; |
||||
|
|
||||
|
@Excel(name = "街道") |
||||
|
private String street; |
||||
|
|
||||
|
@Excel(name = "街道ID") |
||||
|
private Long streetId; |
||||
|
|
||||
|
@Excel(name = "社区") |
||||
|
private String community; |
||||
|
|
||||
|
@Excel(name = "社区ID") |
||||
|
private Long communityId; |
||||
|
|
||||
|
@Excel(name = "网格") |
||||
|
private String grid; |
||||
|
|
||||
|
@Excel(name = "网格ID") |
||||
|
private Long gridId; |
||||
|
|
||||
|
@Excel(name = "话题地址") |
||||
|
private String topicAddress; |
||||
|
|
||||
|
@Excel(name = "话题位置纬度") |
||||
|
private BigDecimal topicLatitude; |
||||
|
|
||||
|
@Excel(name = "话题位置经度") |
||||
|
private BigDecimal topicLongitude; |
||||
|
|
||||
|
@Excel(name = "友邻社群") |
||||
|
private String groupName; |
||||
|
|
||||
|
@Excel(name = "友邻社群ID") |
||||
|
private String groupId; |
||||
|
|
||||
|
@Excel(name = "状态 0:讨论中,5:转议题待审核,10:转议题审核不通过,15:已转议题,20:已转项目,25:已关闭") |
||||
|
private Integer state; |
||||
|
|
||||
|
@Excel(name = "评论数") |
||||
|
private Integer commentNum; |
||||
|
|
||||
|
@Excel(name = "浏览数") |
||||
|
private Integer browseNum; |
||||
|
|
||||
|
@Excel(name = "删除标记 0:未删除,1:已删除") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* 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.redis; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 话题表 话题表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class TopicRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,95 @@ |
|||||
|
/** |
||||
|
* 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.mybatis.service.BaseService; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.dto.topic.TopicDTO; |
||||
|
import com.elink.esua.epdc.modules.topic.entity.TopicEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 话题表 话题表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
public interface TopicService extends BaseService<TopicEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<TopicDTO> |
||||
|
* @author generator |
||||
|
* @date 2019-10-10 |
||||
|
*/ |
||||
|
PageData<TopicDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<TopicDTO> |
||||
|
* @author generator |
||||
|
* @date 2019-10-10 |
||||
|
*/ |
||||
|
List<TopicDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return TopicDTO |
||||
|
* @author generator |
||||
|
* @date 2019-10-10 |
||||
|
*/ |
||||
|
TopicDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-10-10 |
||||
|
*/ |
||||
|
void save(TopicDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-10-10 |
||||
|
*/ |
||||
|
void update(TopicDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-10-10 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
||||
@ -0,0 +1,104 @@ |
|||||
|
/** |
||||
|
* 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.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
||||
|
import com.elink.esua.epdc.dto.topic.TopicDTO; |
||||
|
import com.elink.esua.epdc.modules.topic.dao.TopicDao; |
||||
|
import com.elink.esua.epdc.modules.topic.entity.TopicEntity; |
||||
|
import com.elink.esua.epdc.modules.topic.redis.TopicRedis; |
||||
|
import com.elink.esua.epdc.modules.topic.service.TopicService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 话题表 话题表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-10-10 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> implements TopicService { |
||||
|
|
||||
|
@Autowired |
||||
|
private TopicRedis topicRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<TopicDTO> page(Map<String, Object> params) { |
||||
|
IPage<TopicEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, TopicDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<TopicDTO> list(Map<String, Object> params) { |
||||
|
List<TopicEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, TopicDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<TopicEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<TopicEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public TopicDTO get(String id) { |
||||
|
TopicEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, TopicDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(TopicDTO dto) { |
||||
|
TopicEntity entity = ConvertUtils.sourceToTarget(dto, TopicEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(TopicDTO dto) { |
||||
|
TopicEntity entity = ConvertUtils.sourceToTarget(dto, TopicEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,87 @@ |
|||||
|
server: |
||||
|
port: @server.port@ |
||||
|
servlet: |
||||
|
context-path: /group |
||||
|
|
||||
|
spring: |
||||
|
main: |
||||
|
allow-bean-definition-overriding: true |
||||
|
application: |
||||
|
name: epdc-group-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-group-server-fescar-service-group |
||||
|
datasource: |
||||
|
druid: |
||||
|
driver-class-name: com.mysql.jdbc.Driver |
||||
|
url: @spring.datasource.druid.url@ |
||||
|
username: @spring.datasource.druid.username@ |
||||
|
password: @spring.datasource.druid.password@ |
||||
|
|
||||
|
feign: |
||||
|
hystrix: |
||||
|
enabled: true |
||||
|
httpclient: |
||||
|
enabled: true |
||||
|
|
||||
|
hystrix: |
||||
|
command: |
||||
|
default: |
||||
|
execution: |
||||
|
isolation: |
||||
|
thread: |
||||
|
timeoutInMilliseconds: 60000 #缺省为1000 |
||||
|
|
||||
|
ribbon: |
||||
|
ReadTimeout: 300000 |
||||
|
ConnectTimeout: 300000 |
||||
|
|
||||
|
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 |
||||
|
jdbc-type-for-null: 'null' |
||||
@ -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/group"/> |
||||
|
|
||||
|
<!-- 彩色日志格式 --> |
||||
|
<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,7 @@ |
|||||
|
<?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.group.GroupDao"> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,7 @@ |
|||||
|
<?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.TopicDao"> |
||||
|
|
||||
|
|
||||
|
</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,18 @@ |
|||||
|
<?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"> |
||||
|
<parent> |
||||
|
<artifactId>epdc-module</artifactId> |
||||
|
<groupId>com.esua.epdc</groupId> |
||||
|
<version>1.0.0</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>epdc-group</artifactId> |
||||
|
<packaging>pom</packaging> |
||||
|
<modules> |
||||
|
<module>epdc-group-client</module> |
||||
|
<module>epdc-group-server</module> |
||||
|
</modules> |
||||
|
|
||||
|
</project> |
||||
Loading…
Reference in new issue