[fix]修改整体框架
This commit is contained in:
parent
378aa9df54
commit
0e4d4a31c6
@ -35,6 +35,7 @@
|
||||
<module>ruoyi-common-websocket</module>
|
||||
<module>ruoyi-common-sse</module>
|
||||
<module>ruoyi-common-mongo</module>
|
||||
<module>ruoyi-common-rabbitmq</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
|
@ -1,9 +0,0 @@
|
||||
<archetype>
|
||||
<id>ruoyi-common-mongo</id>
|
||||
<sources>
|
||||
<source>src/main/java/App.java</source>
|
||||
</sources>
|
||||
<testSources>
|
||||
<source>src/test/java/AppTest.java</source>
|
||||
</testSources>
|
||||
</archetype>
|
@ -1,15 +0,0 @@
|
||||
<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/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>$org.dromara</groupId>
|
||||
<artifactId>$ruoyi-common-mongo</artifactId>
|
||||
<version>$5.3.1</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -1,13 +0,0 @@
|
||||
package $org.dromara;
|
||||
|
||||
/**
|
||||
* Hello world!
|
||||
*
|
||||
*/
|
||||
public class App
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
System.out.println( "Hello World!" );
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
package $org.dromara;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest
|
||||
extends TestCase
|
||||
{
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public AppTest( String testName )
|
||||
{
|
||||
super( testName );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the suite of tests being tested
|
||||
*/
|
||||
public static Test suite()
|
||||
{
|
||||
return new TestSuite( AppTest.class );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rigourous Test :-)
|
||||
*/
|
||||
public void testApp()
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
}
|
@ -18,7 +18,6 @@ import java.util.List;
|
||||
@NoArgsConstructor
|
||||
public class TableDataInfo<T> implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
34
ruoyi-common/ruoyi-common-rabbitmq/pom.xml
Normal file
34
ruoyi-common/ruoyi-common-rabbitmq/pom.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<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/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-common-mongo</artifactId>
|
||||
|
||||
<description>
|
||||
ruoyi-common-mongo
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- RuoYi Common Core-->
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>rabbitmq-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
@ -144,6 +144,12 @@
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-rabbitmq</artifactId>
|
||||
<version>5.3.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -2,9 +2,6 @@ package com.wzj.soopin.content.domain.base;
|
||||
|
||||
|
||||
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import com.wzj.soopin.content.utils.PagedGridResult;
|
||||
import com.wzj.soopin.content.utils.RedisOperator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -13,8 +10,7 @@ import java.util.List;
|
||||
|
||||
public class BaseInfoProperties {
|
||||
|
||||
@Autowired
|
||||
public RedisOperator redis;
|
||||
public RedisOperator redis;
|
||||
|
||||
public static final Integer COMMON_START_PAGE = 1;
|
||||
public static final Integer COMMON_START_PAGE_ZERO = 0;
|
||||
@ -52,14 +48,5 @@ public class BaseInfoProperties {
|
||||
// 用户是否喜欢/点赞视频,取代数据库的关联关系,1:喜欢,0:不喜欢(默认) redis_user_like_vlog:{userId}:{vlogId}
|
||||
public static final String REDIS_USER_LIKE_VLOG = "redis_user_like_vlog";
|
||||
|
||||
public PagedGridResult setterPagedGrid(List<?> list, Integer page) {
|
||||
PageInfo<?> pageList = new PageInfo<>(list);
|
||||
PagedGridResult gridResult = new PagedGridResult();
|
||||
gridResult.setRows(list);
|
||||
gridResult.setPage(page);
|
||||
gridResult.setRecords(pageList.getTotal());
|
||||
gridResult.setTotal(pageList.getPages());
|
||||
return gridResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@TableName("t_comment")
|
||||
@ -51,6 +52,6 @@ public class Comment extends TenantEntity {
|
||||
/**
|
||||
* 留言时间
|
||||
*/
|
||||
private Date createTime;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.wzj.soopin.content.mapper.repository;
|
||||
|
||||
import com.wzj.soopin.content.domain.mo.MessageMO;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
@ -21,6 +21,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -51,7 +52,7 @@ public class CommentServiceImpl extends BaseInfoProperties implements CommentSer
|
||||
comment.setFatherCommentId(commentBO.getFatherCommentId());
|
||||
comment.setContent(commentBO.getContent());
|
||||
comment.setLikeCounts(0);
|
||||
comment.setCreateTime(new Date());
|
||||
comment.setCreateTime(LocalDateTime.now());
|
||||
commentMapper.insert(comment);
|
||||
// redis操作放在service中,评论总数的累加
|
||||
redis.increment(REDIS_VLOG_COMMENT_COUNTS + ":" + commentBO.getVlogId(), 1);
|
||||
@ -104,7 +105,7 @@ public class CommentServiceImpl extends BaseInfoProperties implements CommentSer
|
||||
}
|
||||
return cv;
|
||||
}).collect(Collectors.toList());
|
||||
return setterPagedGrid(list, page);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -74,7 +74,7 @@ public class FansServiceImpl extends BaseInfoProperties implements FansService {
|
||||
LambdaQueryWrapper<Fans> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Fans::getVlogerId, vlogerId)
|
||||
.eq(Fans::getFanId, fanId);
|
||||
|
||||
|
||||
return fansMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ public class FansServiceImpl extends BaseInfoProperties implements FansService {
|
||||
Page<VlogerVO> pageParam = new Page<>(page, pageSize);
|
||||
List<VlogerVO> list = fansMapperCustom.queryMyFollows(map);
|
||||
|
||||
return setterPagedGrid(list, page);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -128,6 +128,6 @@ public class FansServiceImpl extends BaseInfoProperties implements FansService {
|
||||
}
|
||||
}
|
||||
|
||||
return setterPagedGrid(list, page);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return setterPagedGrid(voList, page);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -252,7 +252,7 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return setterPagedGrid(voList, page);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@ -332,7 +332,7 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
|
||||
return vo;
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
|
||||
return setterPagedGrid(voList, page);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -341,8 +341,7 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("myId", myId);
|
||||
List<IndexVlogVO> voList = vlogMapperCustom.getMyFollowVlogList(map);
|
||||
|
||||
return setterPagedGrid(voList, page);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -351,7 +350,7 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("myId", myId);
|
||||
List<IndexVlogVO> voList = vlogMapperCustom.getMyFriendVlogList(map);
|
||||
|
||||
return setterPagedGrid(voList, page);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user