# plugin-friends
**Repository Path**: ialley-open-source/plugin-friends
## Basic Information
- **Project Name**: plugin-friends
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: GPL-3.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-04-13
- **Last Updated**: 2024-04-13
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# plugin-friends
* 朋友圈管理插件, 支持在 Console 进行管理以及为主题端提供 `/friends`, `/blogs`, `/blog`, `/blog-requests/add`, `/blog-requests` 页面路由。
* 提供对 RSS 链接的订阅功能,支持获取其订阅内容
前台页面移植自[boyouquan](https://github.com/olzhy/boyouquan)





## 使用方式
* 在应用市场下载并启用。
* 启用插件之后会在 Console 的左侧添加一个`朋友圈`的菜单项,点击即可进入`朋友圈`管理页面。
## 特性
* 内置模板,无需主题支持,但也可以通过主题自定义模板。
## 📃文档
https://moony.la/docs/plugin-friends
## 主题适配
目前此插件为主题端提供了 `/friends` 路由,模板为 `friends.html`,也提供了 Finder API,可以将瞬间列表渲染到任何地方。
## 模板变量
路由信息
* 模板路径:/templates/friends.html
* 访问路径:/friends
### 变量
* friends
* statistical
### 变量类型
* UrlContextListResult<[FriendPostVo](#FriendPostVo)>
* [StatisticalVo](#StatisticalVo)
#### 示例
```bash
```
## Finder API
### listAll()
#### 描述
获取全部订阅文章内容。
#### 参数
无
#### 返回值
List<[FriendPostVo](#FriendPostVo)>
#### 示例
```bash
```
### list(page, size)
#### 描述
根据分页参数获取订阅文章内容。
#### 参数
* page: int - 分页页码,从 1 开始
* size: int - 分页条数
#### 返回值
[ListResult](#ListResult)
#### 示例
```bash
```
### statistical()
#### 描述
订阅统计
#### 参数
无
#### 返回值
[StatisticalVo](#StatisticalVo)
#### 示例
```bash
```
## 类型定义
### FriendPostVo
```bash
{
"metadata": {
"name": "string", // 唯一标识
"generateName": "string",
"version": 0,
"creationTimestamp": "2024-01-16T16:13:17.925131783Z", // 创建时间
},
"apiVersion": "friend.moony.la/v1alpha1",
"kind": "FriendPost",
"spec": {
"url": "string", // 作者链接
"author": "string", // 作者名称
"logo": "string", // 作者logo
"title": "string", // 标题
"link": "string", // 链接
"description": "string", // 内容
"pubDate": "date", // 同步时间
}
}
```
### StatisticalVo
```bash
{
"friendsNum": "Integer", // 订阅数
"activeNum": "Integer", // 同步订阅成功数
"articleNum": "Integer", // 文章数
}
```
### ListResult
```bash
{
"page": 0, // 当前页码
"size": 0, // 每页条数
"total": 0, // 总条数
"items": "List<#FriendPostVo>", // 订阅文章列表数据
"first": true, // 是否为第一页
"last": true, // 是否为最后一页
"hasNext": true, // 是否有下一页
"hasPrevious": true, // 是否有上一页
"totalPages": 0 // 总页数
}
```
### UrlContextListResult
```bash
{
"page": 0, // 当前页码
"size": 0, // 每页条数
"total": 0, // 总条数
"items": "List<#FriendPostVo>", // 订阅文章列表数据
"first": true, // 是否为第一页
"last": true, // 是否为最后一页
"hasNext": true, // 是否有下一页
"hasPrevious": true, // 是否有上一页
"totalPages": 0, // 总页数
"prevUrl": "string", // 上一页链接
"nextUrl": "string" // 下一页链接
}
```
## 开发环境
```bash
git clone git@github.com:chengzhongxue/plugin-friends.git
# 或者当你 fork 之后
git clone git@github.com:{your_github_id}/plugin-friends.git
```
```bash
cd path/to/plugin-friends
```
```bash
# macOS / Linux
./gradlew pnpmInstall
# Windows
./gradlew.bat pnpmInstall
```
```bash
# macOS / Linux
./gradlew haloServer
# Windows
./gradlew.bat haloServer
```
```bash
# macOS / Linux
./gradlew build
# Windows
./gradlew.bat build
```
修改 Halo 配置文件:
```yaml
halo:
plugin:
runtime-mode: development
classes-directories:
- "build/classes"
- "build/resources"
lib-directories:
- "libs"
fixedPluginPath:
- "/path/to/plugin-friends"
```