Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Task][OSPP] HertzBeat Official Template Marketplace #2641

Merged
merged 66 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a14dcfe
first
All-The-Best-for Aug 29, 2024
c588304
Merge branch 'master' into ospp
Calvin979 Aug 30, 2024
3b2b14d
first
All-The-Best-for Aug 30, 2024
9a2e26b
Merge remote-tracking branch 'origin/ospp' into ospp
All-The-Best-for Aug 30, 2024
fd7bfb3
Merge branch 'master' into ospp
Aias00 Aug 31, 2024
d571455
Merge branch 'master' into ospp
yuluo-yx Aug 31, 2024
d761f21
Merge branch 'master' into ospp
Aias00 Aug 31, 2024
db47b2b
Merge branch 'master' into ospp
Aias00 Sep 2, 2024
e3fccde
Merge branch 'master' into ospp
Aias00 Sep 3, 2024
4257d57
Merge branch 'master' into ospp
Aias00 Sep 3, 2024
e746db8
Merge branch 'master' into ospp
Aias00 Sep 3, 2024
f5c6bcb
Merge branch 'master' into ospp
Aias00 Sep 4, 2024
735cfbc
Merge branch 'master' into ospp
Aias00 Sep 4, 2024
95414a0
Merge branch 'master' into ospp
Aias00 Sep 4, 2024
d4b58f7
Merge branch 'master' into ospp
Aias00 Sep 5, 2024
f719f36
Merge branch 'master' into ospp
Aias00 Sep 6, 2024
6e2d593
Merge branch 'master' into ospp
yuluo-yx Sep 7, 2024
95c0079
Merge branch 'master' into ospp
Aias00 Sep 7, 2024
713a78c
Merge branch 'master' into ospp
Aias00 Sep 8, 2024
2d3e0fa
Merge branch 'master' into ospp
Aias00 Sep 8, 2024
76b87c6
Merge branch 'master' into ospp
Aias00 Sep 9, 2024
bd9385d
Merge branch 'master' into ospp
Aias00 Sep 9, 2024
6980a61
Merge branch 'master' into ospp
Aias00 Sep 10, 2024
87c4ecb
Merge branch 'master' into ospp
Aias00 Sep 12, 2024
fb5cd14
Merge branch 'master' into ospp
Aias00 Sep 13, 2024
b8790a7
Merge branch 'master' into ospp
Aias00 Sep 13, 2024
a4b08eb
Merge branch 'master' into ospp
Aias00 Sep 14, 2024
b31ae6e
Merge branch 'master' into ospp
Aias00 Sep 15, 2024
2031ceb
Merge branch 'master' into ospp
Aias00 Sep 15, 2024
9968433
Merge branch 'master' into ospp
Aias00 Sep 17, 2024
9c2ddb9
Merge branch 'master' into ospp
Aias00 Sep 19, 2024
9fc22eb
Merge branch 'master' into ospp
Aias00 Sep 21, 2024
0369f58
Merge branch 'master' into ospp
Aias00 Sep 24, 2024
0d6ce3c
Merge branch 'master' into ospp
Aias00 Sep 25, 2024
e8f1ffa
Merge branch 'apache:master' into ospp
All-The-Best-for Sep 26, 2024
b7441f5
基本功能完善备份
All-The-Best-for Sep 26, 2024
5c5bcf0
Merge branch 'apache:master' into ospp
All-The-Best-for Sep 29, 2024
62f4bec
clear
All-The-Best-for Sep 29, 2024
cbd1123
[Task][OSPP] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Sep 29, 2024
21c89a8
[feat] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Sep 29, 2024
24595fb
Merge remote-tracking branch 'origin/ospp' into ospp
All-The-Best-for Sep 29, 2024
e89c881
Merge branch 'master' into ospp
Aias00 Oct 8, 2024
b88d5ef
Merge branch 'master' into ospp
Aias00 Oct 16, 2024
76bb28c
[feat] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Oct 19, 2024
c4d5cb1
Merge remote-tracking branch 'origin/ospp' into ospp
All-The-Best-for Oct 19, 2024
0c7feb0
Merge branch 'master' into ospp
tomsun28 Oct 22, 2024
a0eb413
Merge branch 'apache:master' into ospp
All-The-Best-for Oct 24, 2024
cafc426
[feat] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Oct 24, 2024
679e019
[feat] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Oct 24, 2024
b8f69c1
[feat] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Oct 24, 2024
5e36b73
Merge branch 'master' into ospp
Aias00 Oct 26, 2024
eceb67f
Merge branch 'master' into ospp
Aias00 Oct 26, 2024
7e1901c
[feat] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Oct 26, 2024
a2b1f3f
Merge remote-tracking branch 'origin/ospp' into ospp
All-The-Best-for Oct 26, 2024
fdf5e1f
[feat] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Oct 26, 2024
db78666
Merge branch 'master' into ospp
Aias00 Oct 27, 2024
54c487a
Merge branch 'master' into ospp
Aias00 Oct 29, 2024
89f1ba1
Merge branch 'master' into ospp
Aias00 Oct 29, 2024
ae89c06
[feat] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Oct 29, 2024
4017ddf
[feat] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Oct 29, 2024
5e2d409
[feat] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Oct 29, 2024
a420b3d
[feat] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Oct 30, 2024
a4554a8
[feat] HertzBeat Official Template Marketplace [#1792]
All-The-Best-for Oct 30, 2024
01cc49b
Merge branch 'master' into ospp
zqr10159 Oct 30, 2024
84657b1
Merge branch 'master' into ospp
All-The-Best-for Oct 30, 2024
e566495
Merge branch 'master' into ospp
zqr10159 Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions templatehub/README-EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Plan
## Completed
### Backend
- Modify the persistence framework to JPA`
- Replace the utility class with the community utility class: Replace the 'Message' return class and modify the backend request return format
- Template upload interface: Upload the first version of a template series
- Version upload interface: Upload subsequent versions of a template series
- Template search interface: Based on user query templates and querying all templates
- Abstract file upload interface: complete the implementation class adaptation of MinIO, configurable storage system
- Template download interface: provides a permanent download address, maps the address, and hides the MinIO address from the user
- Sharing interface: Generate a download URL for a certain version for sharing based on Base62 encoding`
- Sharing and downloading interface: Download files by accessing the sharing link in the browser
### Front end
- All template query function
- Template upload function
- Download function for a certain template and version file


## Todo
- Organize the design framework
### Backend
- Like or favorite statistics function:
- Add likes or favorites statistics in the 'template' and 'version' tables
- Users can like and bookmark after logging in
- Template image function: The system automatically assigns images based on categories or generates random images similar to 'GitHub'
- Category and tag management function
- Template deletion and removal function
- Backend management function
- Login and registration function
### Front end
- Template information display
- Implementation of version query function
- Sharing Function Implementation
- Implementation of version upload function

## 🛡️ License
[`Apache License, Version 2.0`](https://www.apache.org/licenses/LICENSE-2.0.html)
37 changes: 37 additions & 0 deletions templatehub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 计划
## 已完成
### 后端
- 修改持久化框架为`JPA`
- 工具类替换为社区工具类:替换`Message`返回类,修改后端请求返回格式
- 模版上传接口:上传一个模版系列的第一个版本
- 版本上传接口:上传某个模版系列的后续版本
- 模版搜索接口:根据用户查询模版及查询所有模版
- 抽象文件上传接口:完成适配`MinIO`的实现类,可配置存储系统
- 模版下载接口:提供永久下载地址,对地址进行映射,对用户隐藏地MinIO地址
- 分享接口:根据`Base62`编码生成用于分享的某版本下载`URL`
- 分享下载接口:通过在浏览器中访问分享链接下载文件
### 前端
- 全部模版查询功能
- 模版上传功能
- 某模版某版本文件下载功能


## 待完成
- 整理设计框架
### 后端
- 点赞量或收藏量统计功能:
- 在`template`及`version`表中添加点赞量或者收藏量统计
- 用户登录后可进行点赞收藏
- 模版图片功能:系统根据类别自动指定图片或类似`github`生成随机图片
- 类别、`tag`管理功能
- 模版删除、下架功能
- 后台管理功能
- 登录注册功能
### 前端
- 模版信息展示
- 版本查询功能实装
- 分享功能实装
- 版本上传功能实装

## 🛡️ License
[`Apache License, Version 2.0`](https://www.apache.org/licenses/LICENSE-2.0.html)
144 changes: 144 additions & 0 deletions templatehub/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.apache.hertzbeat.templatehub</groupId>
<artifactId>hertzbeat-template-hub</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>hertzbeat-template-hub</name>
<description>hertzbeat-template-hub</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<properties>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>3.3.2</spring-boot.version>
<druid-spring-boot-starter.version>1.2.23</druid-spring-boot-starter.version>
<mysql-connector-j.version>8.3.0</mysql-connector-j.version>
<mybatis-plus.version>3.5.7</mybatis-plus.version>
<mybatis-plus-boot-starter.version>3.5.7</mybatis-plus-boot-starter.version>
<minio.version>8.4.3</minio.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
</properties>
<dependencies>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.23</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.2.22</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<!--Spring boot单元测试-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>

<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>8.5.11</version>
</dependency>

<!-- okHttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.12.0</version>
</dependency>


</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hertzbeat.templatehub;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@EnableTransactionManagement
public class HertzbeatTemplateHubApplication {

public static void main(String[] args) {
SpringApplication.run(HertzbeatTemplateHubApplication.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hertzbeat.templatehub.config;

import org.apache.hertzbeat.templatehub.service.FileStorageService;
import org.apache.hertzbeat.templatehub.service.impl.LocalFileStorageServiceImpl;
import org.apache.hertzbeat.templatehub.service.impl.MinIOFileStorageServiceImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FileStorageConfig {

@Value("${file.storage.type}")
private String storageType;

@Value("${minio.endpoint}")
private String minioEndpoint;

@Value("${minio.accessKey}")
private String accessKey;

@Value("${minio.secretKey}")
private String secretKey;

@Bean
public FileStorageService fileStorageService() {
if ("minio".equalsIgnoreCase(storageType)) {
return new MinIOFileStorageServiceImpl(
minioEndpoint,
accessKey,
secretKey
);
} else if ("local".equalsIgnoreCase(storageType)) {
return new LocalFileStorageServiceImpl();
} else {
throw new IllegalArgumentException("Invalid file storage type: " + storageType);
}
}
}
Loading
Loading