This commit is contained in:
ls
2024-11-18 15:52:18 +08:00
parent 86fc999290
commit 3a34ee483a
7 changed files with 27 additions and 5 deletions

View File

@@ -79,8 +79,6 @@ services:
container_name: physical-web
image: registry.cn-shanghai.aliyuncs.com/physical/physical-web
hostname: physical-web
depends_on:
- physical-launcher
networks:
- physical-boot
ports:

View File

@@ -79,8 +79,6 @@ services:
container_name: physical-web
image: registry.cn-shanghai.aliyuncs.com/physical/physical-web
hostname: physical-web
depends_on:
- physical-launcher
networks:
- physical-boot
ports:

View File

@@ -249,7 +249,7 @@ jeecg:
# minio文件上传
minio:
minio_url: http://physical-minio:9000
minio_public_url: http://58.215.212.230:8005/oss/
minio_public_url: /oss/
minio_name: root
minio_pass: 12345678
bucketName: physical

View File

@@ -59,6 +59,8 @@ public class DocumentLibraryController extends JeecgController<DocumentLibrary,
home.setFavorite(documentFavoritesService.getTopFavoritesByUserId(userByName.getId()));
home.setLatest(documentLibraryService.getLatest());
home.setRecently(documentVisitHistoryService.getRecently(userByName.getId()));
home.setTotal(documentLibraryService.getTotal());
home.setToday(documentLibraryService.getToday());
return Result.OK(home);
}

View File

@@ -26,4 +26,8 @@ public class DocumentHome implements Serializable {
private List<DocumentLibrary> latest;
@Schema(description = "最近访问")
private List<DocumentLibrary> recently;
@Schema(description = "文档总计")
private Long total;
@Schema(description = "今日新增")
private Long today;
}

View File

@@ -14,4 +14,8 @@ import java.util.List;
public interface IDocumentLibraryService extends IService<DocumentLibrary> {
List<DocumentLibrary> getLatest();
Long getTotal();
Long getToday();
}

View File

@@ -1,13 +1,16 @@
package org.jeecg.modules.database.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.database.entity.DocumentLibrary;
import org.jeecg.modules.database.mapper.DocumentLibraryMapper;
import org.jeecg.modules.database.service.IDocumentLibraryService;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
@@ -26,4 +29,17 @@ public class DocumentLibraryServiceImpl extends ServiceImpl<DocumentLibraryMappe
Page<DocumentLibrary> page = new Page<>(1, 5);
return list(page, queryWrapper);
}
@Override
public Long getTotal() {
return count();
}
@Override
public Long getToday() {
QueryWrapper<DocumentLibrary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("DATE_FORMAT (create_time,'%Y-%m-%d')",
DateUtils.formatDate(new Date(), "yyyy-MM-dd"));
return count(queryWrapper);
}
}