Merge pull request #2 from rocboss/main

update
pull/180/head
Klee 3 years ago committed by GitHub
commit e768179d6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

1
.gitattributes vendored

@ -1,3 +1,4 @@
*.js linguist-language=go *.js linguist-language=go
*.css linguist-language=go *.css linguist-language=go
*.vue linguist-language=go *.vue linguist-language=go
*.html linguist-language=go

@ -1,58 +1,128 @@
# PaoPao CE <div id="top"></div>
官网 https://www.paopao.info
## 1. 代码说明 <!-- PROJECT SHIELDS -->
[![Go Report Card][goreport-shield]][goreport-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![MIT License][license-shield]][license-url]
[![Contributors][contributors-shield]][contributors-url]
[![Issues][issues-shield]][issues-url]
- paopao-api 泡泡后端 <!-- PROJECT LOGO -->
- paopao-web 泡泡前端 <div align="center">
<a href="https://github.com/rocboss/paopao-ce">
## 2. 安装说明 <img src="https://cdn.rocs.me/static/paopao-logo.png" alt="Logo" width="80" height="80">
</a>
- 需要提前安装Go(>=1.17)、Node.js(>=14)、MySQL(>=5.7)、Redis环境
- 需要安装 Zinc (轻量级全文搜索引擎),可以查阅 https://zincsearch.com/ 安装
### 2.1 paopao-api 后端服务
- 导入 `paopao-api` 目录下的`paopao.sql`文件至数据库
- 拷贝 config.yaml.sample 文件至 config.yaml然后按照注释完成配置修改
```
cd 项目根目录/paopao-api
go mod download
go build .
```
编译成功后,将产出 `paopao-api` 二进制文件,运行:
```
chmod +x paopao-api
./paopao-api
```
即可正常启动
### 2.2 paopao-web 前端服务
编译前需要修改 .env里面的后端地址
```
cd 项目根目录/paopao-web
vim .env
yarn
yarn build
```
build完成后可以在dist目录获取编译产出配置nginx指向至该目录即可
## 3. 其他
后端服务建议使用 supervisor 守护进程然后通过nginx反向代理
短信通道使用的juhe数据如果申请不下来可以考虑替换其他服务商的
代码结构比较简单喜欢的朋友欢迎贡献PR。
<h3 align="center">PaoPao</h3>
<p align="center">
🔥一个清新文艺的微社区
<br />
<a href="https://www.paopao.info/">View Demo</a>
·
<a href="https://github.com/rocboss/paopao-ce/issues">Report Bug</a>
·
<a href="https://www.rocs.me/archives/paopao.html">Features</a>
</p>
</div>
## 1. 截图预览
[![明色主题][product-light-screenshot]](https://www.paopao.info)
[![暗色主题][product-dark-screenshot]](https://www.paopao.info)
更多演示请前往[官网](https://www.paopao.info)体验(谢绝灌水)
<p align="right">(<a href="#top">back to top</a>)</p>
<!-- GETTING STARTED -->
## 2. 快速开始
### 2.1 技术栈
PaoPao主要由以下优秀的开源项目/工具构建
* [Go](https://go.dev/)
* [Gin](https://gin-gonic.com/)
* [Zinc](https://zinclabs.io/)
* [Naive UI](https://www.naiveui.com/)
* [Vue.js](https://vuejs.org/)
* [Vite.js](https://vitejs.dev/)
### 2.2 环境要求
- Go (1.17+)
- Node.js (14+)
- MySQL (5.7+)
- Redis
- Zinc
\* Zinc是一款轻量级全文搜索引擎可以查阅 https://zincsearch.com/ 安装
以上环境版本为PaoPao官方的开发版本仅供参考其他版本的环境未进行充分测试
<br />
### 3. 安装说明
克隆代码库
```sh
git clone https://github.com/rocboss/paopao-ce.git
```
#### 3.1 后端
1. 导入项目根目录下的 `paopao.sql` 文件至MySQL数据库
2. 拷贝项目根目录下 `config.yaml.sample` 文件至 `config.yaml`,按照注释完成配置编辑
3. 编译后端
```sh
go mod download
go build .
```
4. 启动后端
```sh
chmod +x paopao-api
./paopao-api
```
#### 3.2 前端
1. 进入前端目录 `web`,编辑 `.env` 文件中后端服务地址,下载依赖包
```sh
cd ./web
vim .env
yarn
```
2. 编译前端
```sh
yarn build
```
build完成后可以在dist目录获取编译产出配置nginx指向至该目录即可
#### 3.3 其他
建议后端服务使用 `supervisor` 守护进程并通过nginx反向代理后提供API给前端服务调用。
短信通道使用的juhe数据如果申请不下来可以考虑替换其他服务商。
代码结构比较简单喜欢的朋友欢迎给个Star、贡献PR。
<!-- MARKDOWN LINKS & IMAGES -->
[contributors-shield]: https://img.shields.io/github/contributors/rocboss/paopao-ce?style=flat
[contributors-url]: https://github.com/rocboss/paopao-ce/graphs/contributors
[goreport-shield]: https://goreportcard.com/badge/github.com/rocboss/paopao-ce
[goreport-url]: https://goreportcard.com/report/github.com/rocboss/paopao-ce
[forks-shield]: https://img.shields.io/github/forks/rocboss/paopao-ce?style=flat
[forks-url]: https://github.com/rocboss/paopao-ce/network/members
[stars-shield]: https://img.shields.io/github/stars/rocboss/paopao-ce.svg?style=flat
[stars-url]: https://github.com/rocboss/paopao-ce/stargazers
[issues-shield]: https://img.shields.io/github/issues/rocboss/paopao-ce.svg?style=flat
[issues-url]: https://github.com/rocboss/paopao-ce/issues
[license-shield]: https://img.shields.io/github/license/rocboss/paopao-ce.svg?style=flat
[license-url]: https://github.com/rocboss/paopao-ce/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat&logo=linkedin&colorB=555
[product-light-screenshot]: https://cdn.rocs.me/static/paopao-light.jpeg
[product-dark-screenshot]: https://cdn.rocs.me/static/paopao-dark.jpeg

@ -3,7 +3,7 @@ package global
import ( import (
"sync" "sync"
"github.com/rocboss/paopao-api/pkg/setting" "github.com/rocboss/paopao-ce/pkg/setting"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )

@ -1,4 +1,4 @@
module github.com/rocboss/paopao-api module github.com/rocboss/paopao-ce
go 1.16 go 1.16

@ -6,10 +6,10 @@ import (
"time" "time"
"github.com/go-redis/redis/v8" "github.com/go-redis/redis/v8"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/pkg/logger" "github.com/rocboss/paopao-ce/pkg/logger"
"github.com/rocboss/paopao-api/pkg/setting" "github.com/rocboss/paopao-ce/pkg/setting"
) )
func init() { func init() {

@ -1,6 +1,6 @@
package dao package dao
import "github.com/rocboss/paopao-api/internal/model" import "github.com/rocboss/paopao-ce/internal/model"
func (d *Dao) CreateAttachment(attachment *model.Attachment) (*model.Attachment, error) { func (d *Dao) CreateAttachment(attachment *model.Attachment) (*model.Attachment, error) {
return attachment.Create(d.engine) return attachment.Create(d.engine)

@ -1,6 +1,6 @@
package dao package dao
import "github.com/rocboss/paopao-api/internal/model" import "github.com/rocboss/paopao-ce/internal/model"
func (d *Dao) GetComments(conditions *model.ConditionsT, offset, limit int) ([]*model.Comment, error) { func (d *Dao) GetComments(conditions *model.ConditionsT, offset, limit int) ([]*model.Comment, error) {
return (&model.Comment{}).List(d.engine, conditions, offset, limit) return (&model.Comment{}).List(d.engine, conditions, offset, limit)

@ -1,6 +1,6 @@
package dao package dao
import "github.com/rocboss/paopao-api/internal/model" import "github.com/rocboss/paopao-ce/internal/model"
func (d *Dao) GetCommentContentsByIDs(ids []int64) ([]*model.CommentContent, error) { func (d *Dao) GetCommentContentsByIDs(ids []int64) ([]*model.CommentContent, error) {
commentContent := &model.CommentContent{} commentContent := &model.CommentContent{}

@ -1,7 +1,7 @@
package dao package dao
import ( import (
"github.com/rocboss/paopao-api/pkg/zinc" "github.com/rocboss/paopao-ce/pkg/zinc"
"gorm.io/gorm" "gorm.io/gorm"
) )

@ -1,6 +1,6 @@
package dao package dao
import "github.com/rocboss/paopao-api/internal/model" import "github.com/rocboss/paopao-ce/internal/model"
func (d *Dao) CreateMessage(msg *model.Message) (*model.Message, error) { func (d *Dao) CreateMessage(msg *model.Message) (*model.Message, error) {
return msg.Create(d.engine) return msg.Create(d.engine)

@ -3,7 +3,7 @@ package dao
import ( import (
"time" "time"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
) )
func (d *Dao) CreatePost(post *model.Post) (*model.Post, error) { func (d *Dao) CreatePost(post *model.Post) (*model.Post, error) {

@ -1,6 +1,6 @@
package dao package dao
import "github.com/rocboss/paopao-api/internal/model" import "github.com/rocboss/paopao-ce/internal/model"
func (d *Dao) CreatePostContent(content *model.PostContent) (*model.PostContent, error) { func (d *Dao) CreatePostContent(content *model.PostContent) (*model.PostContent, error) {
return content.Create(d.engine) return content.Create(d.engine)

@ -1,7 +1,7 @@
package dao package dao
import ( import (
"github.com/rocboss/paopao-api/pkg/zinc" "github.com/rocboss/paopao-ce/pkg/zinc"
) )
type SearchType string type SearchType string

@ -1,6 +1,6 @@
package dao package dao
import "github.com/rocboss/paopao-api/internal/model" import "github.com/rocboss/paopao-ce/internal/model"
func (d *Dao) CreateTag(tag *model.Tag) (*model.Tag, error) { func (d *Dao) CreateTag(tag *model.Tag) (*model.Tag, error) {
t, err := tag.Get(d.engine) t, err := tag.Get(d.engine)

@ -10,8 +10,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"gopkg.in/resty.v1" "gopkg.in/resty.v1"
) )

@ -1,8 +1,8 @@
package dao package dao
import ( import (
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"gorm.io/gorm" "gorm.io/gorm"
) )

@ -5,10 +5,10 @@ import (
"github.com/dgrijalva/jwt-go" "github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/pkg/app" "github.com/rocboss/paopao-ce/pkg/app"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
) )
func JWT() gin.HandlerFunc { func JWT() gin.HandlerFunc {

@ -2,9 +2,9 @@ package middleware
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/pkg/app" "github.com/rocboss/paopao-ce/pkg/app"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
) )
func Priv() gin.HandlerFunc { func Priv() gin.HandlerFunc {

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/pkg/setting" "github.com/rocboss/paopao-ce/pkg/setting"
"gorm.io/driver/mysql" "gorm.io/driver/mysql"
"gorm.io/gorm" "gorm.io/gorm"
"gorm.io/gorm/logger" "gorm.io/gorm/logger"

@ -9,12 +9,12 @@ import (
"github.com/disintegration/imaging" "github.com/disintegration/imaging"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gofrs/uuid" "github.com/gofrs/uuid"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/internal/service" "github.com/rocboss/paopao-ce/internal/service"
"github.com/rocboss/paopao-api/pkg/app" "github.com/rocboss/paopao-ce/pkg/app"
"github.com/rocboss/paopao-api/pkg/convert" "github.com/rocboss/paopao-ce/pkg/convert"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
) )
func GeneratePath(s string) string { func GeneratePath(s string) string {

@ -2,12 +2,12 @@ package api
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/internal/service" "github.com/rocboss/paopao-ce/internal/service"
"github.com/rocboss/paopao-api/pkg/app" "github.com/rocboss/paopao-ce/pkg/app"
"github.com/rocboss/paopao-api/pkg/convert" "github.com/rocboss/paopao-ce/pkg/convert"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
) )
func GetPostComments(c *gin.Context) { func GetPostComments(c *gin.Context) {

@ -10,13 +10,13 @@ import (
"github.com/afocus/captcha" "github.com/afocus/captcha"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gofrs/uuid" "github.com/gofrs/uuid"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/internal/service" "github.com/rocboss/paopao-ce/internal/service"
"github.com/rocboss/paopao-api/pkg/app" "github.com/rocboss/paopao-ce/pkg/app"
"github.com/rocboss/paopao-api/pkg/convert" "github.com/rocboss/paopao-ce/pkg/convert"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
"github.com/rocboss/paopao-api/pkg/util" "github.com/rocboss/paopao-ce/pkg/util"
) )
const MAX_PHONE_CAPTCHA = 10 const MAX_PHONE_CAPTCHA = 10

@ -2,11 +2,11 @@ package api
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/internal/service" "github.com/rocboss/paopao-ce/internal/service"
"github.com/rocboss/paopao-api/pkg/app" "github.com/rocboss/paopao-ce/pkg/app"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
) )
func GetUnreadMsgCount(c *gin.Context) { func GetUnreadMsgCount(c *gin.Context) {

@ -2,13 +2,13 @@ package api
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/dao" "github.com/rocboss/paopao-ce/internal/dao"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/internal/service" "github.com/rocboss/paopao-ce/internal/service"
"github.com/rocboss/paopao-api/pkg/app" "github.com/rocboss/paopao-ce/pkg/app"
"github.com/rocboss/paopao-api/pkg/convert" "github.com/rocboss/paopao-ce/pkg/convert"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
) )
func GetPostList(c *gin.Context) { func GetPostList(c *gin.Context) {

@ -7,12 +7,12 @@ import (
"unicode/utf8" "unicode/utf8"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/internal/service" "github.com/rocboss/paopao-ce/internal/service"
"github.com/rocboss/paopao-api/pkg/app" "github.com/rocboss/paopao-ce/pkg/app"
"github.com/rocboss/paopao-api/pkg/convert" "github.com/rocboss/paopao-ce/pkg/convert"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
"github.com/smartwalle/alipay/v3" "github.com/smartwalle/alipay/v3"
) )

@ -5,8 +5,8 @@ import (
"github.com/gin-contrib/cors" "github.com/gin-contrib/cors"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/rocboss/paopao-api/internal/middleware" "github.com/rocboss/paopao-ce/internal/middleware"
"github.com/rocboss/paopao-api/internal/routers/api" "github.com/rocboss/paopao-ce/internal/routers/api"
) )
func NewRouter() *gin.Engine { func NewRouter() *gin.Engine {

@ -1,6 +1,6 @@
package service package service
import "github.com/rocboss/paopao-api/internal/model" import "github.com/rocboss/paopao-ce/internal/model"
func (svc *Service) CreateAttachment(attachment *model.Attachment) (*model.Attachment, error) { func (svc *Service) CreateAttachment(attachment *model.Attachment) (*model.Attachment, error) {
return svc.dao.CreateAttachment(attachment) return svc.dao.CreateAttachment(attachment)

@ -4,10 +4,10 @@ import (
"strings" "strings"
"time" "time"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
"github.com/rocboss/paopao-api/pkg/util" "github.com/rocboss/paopao-ce/pkg/util"
) )
type CommentCreationReq struct { type CommentCreationReq struct {

@ -1,8 +1,8 @@
package service package service
import ( import (
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
) )
type ReadMessageReq struct { type ReadMessageReq struct {

@ -7,11 +7,11 @@ import (
"strings" "strings"
"time" "time"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/dao" "github.com/rocboss/paopao-ce/internal/dao"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/pkg/util" "github.com/rocboss/paopao-ce/pkg/util"
"github.com/rocboss/paopao-api/pkg/zinc" "github.com/rocboss/paopao-ce/pkg/zinc"
) )
type TagType string type TagType string

@ -2,9 +2,9 @@ package service
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/dao" "github.com/rocboss/paopao-ce/internal/dao"
"github.com/rocboss/paopao-api/pkg/zinc" "github.com/rocboss/paopao-ce/pkg/zinc"
) )
type Service struct { type Service struct {

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"sort" "sort"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/pkg/util" "github.com/rocboss/paopao-ce/pkg/util"
) )
func (svc *Service) GetParamSign(param map[string]interface{}, secretKey string) string { func (svc *Service) GetParamSign(param map[string]interface{}, secretKey string) string {

@ -8,11 +8,11 @@ import (
"unicode/utf8" "unicode/utf8"
"github.com/gofrs/uuid" "github.com/gofrs/uuid"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/pkg/convert" "github.com/rocboss/paopao-ce/pkg/convert"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
"github.com/rocboss/paopao-api/pkg/util" "github.com/rocboss/paopao-ce/pkg/util"
) )
const MAX_CAPTCHA_TIMES = 2 const MAX_CAPTCHA_TIMES = 2

@ -3,9 +3,9 @@ package service
import ( import (
"time" "time"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
) )
type RechargeReq struct { type RechargeReq struct {

@ -5,8 +5,8 @@ import (
"net/http" "net/http"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/routers" "github.com/rocboss/paopao-ce/internal/routers"
) )
func main() { func main() {

@ -1,3 +0,0 @@
{
"recommendations": ["johnsoncodehk.volar"]
}

@ -1,7 +0,0 @@
# Vue 3 + Vite
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
## Recommended IDE Setup
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)

@ -1,18 +0,0 @@
declare module NetParams {
interface AuthUserLogin {
username?: string,
password?: string
}
interface UserGetCollections {
list: any[],
pager: AnyObject
}
interface PostGetPosts {
list: any[],
pager: AnyObject
}
}

@ -1,20 +0,0 @@
declare module NetReq {
interface AuthUserLogin {
token?: string
}
interface UserGetCollections {
list: any[],
pager: AnyObject
}
type UserGetSuggestUsers = string[]
type UserGetSuggestTags = string[]
interface PostGetPosts {
list: any[],
pager: AnyObject
}
}

@ -1,45 +0,0 @@
declare module Item {
interface UserInfo {
id: number,
username: string,
nickname: string,
avatar: string
}
interface CommentItemProps {
id: number | string,
content: string
}
interface CommentProps extends CommentItemProps {
type: number,
user: UserInfo,
contents: CommentProps[],
replies: ReplyProps[],
ip_loc: string,
created_on: number
}
interface ReplyProps {
id: number,
user_id: number,
user: UserInfo
}
interface PostProps {
id: number,
}
interface MessageProps {
id: number,
type: number,
is_read: number,
sender_user: UserInfo
post: PostProps,
post_id: number,
created_on: number,
breif: string
}
}

@ -1,3 +0,0 @@
/// <reference types="vite/client" />
/// <reference types="vue/ref-macros" />
/// <reference types="naive-ui/volar" />

@ -5,7 +5,7 @@ import (
"os" "os"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/rocboss/paopao-api/pkg/errcode" "github.com/rocboss/paopao-ce/pkg/errcode"
) )
type Response struct { type Response struct {

@ -4,8 +4,8 @@ import (
"time" "time"
"github.com/dgrijalva/jwt-go" "github.com/dgrijalva/jwt-go"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/internal/model" "github.com/rocboss/paopao-ce/internal/model"
) )
type Claims struct { type Claims struct {

@ -2,8 +2,8 @@ package app
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/pkg/convert" "github.com/rocboss/paopao-ce/pkg/convert"
) )
func GetPage(c *gin.Context) int { func GetPage(c *gin.Context) int {

@ -6,8 +6,8 @@ import (
"io" "io"
"time" "time"
"github.com/rocboss/paopao-api/global" "github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-api/pkg/setting" "github.com/rocboss/paopao-ce/pkg/setting"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"gopkg.in/natefinch/lumberjack.v2" "gopkg.in/natefinch/lumberjack.v2"
"gopkg.in/resty.v1" "gopkg.in/resty.v1"

@ -7,7 +7,7 @@ import (
"github.com/fbsobreira/gotron-sdk/pkg/proto/core" "github.com/fbsobreira/gotron-sdk/pkg/proto/core"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/rocboss/paopao-api/pkg/crypto" "github.com/rocboss/paopao-ce/pkg/crypto"
) )
// SignTransaction 签名交易 // SignTransaction 签名交易

@ -30,6 +30,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^17.0.35", "@types/node": "^17.0.35",
"@types/qrcode": "^1.4.2",
"@vitejs/plugin-vue": "^2.3.1", "@vitejs/plugin-vue": "^2.3.1",
"@vue/compiler-sfc": "^3.2.36", "@vue/compiler-sfc": "^3.2.36",
"typescript": "^4.7.2", "typescript": "^4.7.2",

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

@ -5,7 +5,7 @@ import request from '@/utils/request';
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getPosts = (params: any) => { export const getPosts = (params: NetParams.PostGetPosts) => {
return request({ return request({
method: 'get', method: 'get',
url: '/posts', url: '/posts',
@ -18,12 +18,12 @@ export const getPosts = (params: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getTags = (params: any) => { export const getTags = (params: NetParams.PostGetTags) => {
return request({ return request({
method: 'get', method: 'get',
url: '/tags', url: '/tags',
params params
}); }) as unknown as Promise<NetReq.PostGetTags>;
}; };
/** /**
@ -31,12 +31,12 @@ export const getTags = (params: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getPost = (params: any) => { export const getPost = (params: NetParams.PostGetPost) => {
return request({ return request({
method: 'get', method: 'get',
url: '/post', url: '/post',
params params
}); }) as unknown as Promise<NetReq.PostGetPost>;
}; };
/** /**
@ -44,12 +44,12 @@ export const getPost = (params: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getPostStar = (params: any) => { export const getPostStar = (params: NetParams.PostPostStar) => {
return request({ return request({
method: 'get', method: 'get',
url: '/post/star', url: '/post/star',
params params
}); }) as unknown as Promise<NetReq.PostGetPostStar>;
}; };
/** /**
@ -57,12 +57,12 @@ export const getPostStar = (params: any) => {
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const postStar = (data: any) => { export const postStar = (data: NetParams.PostPostStar) => {
return request({ return request({
method: 'post', method: 'post',
url: '/post/star', url: '/post/star',
data data
}); }) as unknown as Promise<NetReq.PostPostStar>;
}; };
/** /**
@ -70,12 +70,12 @@ export const postStar = (data: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getPostCollection = (params: any) => { export const getPostCollection = (params: NetParams.PostGetPostCollection) => {
return request({ return request({
method: 'get', method: 'get',
url: '/post/collection', url: '/post/collection',
params params
}); }) as unknown as Promise<NetReq.PostGetPostCollection>;
}; };
/** /**
@ -83,12 +83,12 @@ export const getPostCollection = (params: any) => {
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const postCollection = (data: any) => { export const postCollection = (data: NetParams.PostPostCollection) => {
return request({ return request({
method: 'post', method: 'post',
url: '/post/collection', url: '/post/collection',
data data
}); }) as unknown as Promise<NetReq.PostPostCollection>;
}; };
/** /**
@ -96,12 +96,12 @@ export const postCollection = (data: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getPostComments = (params: any) => { export const getPostComments = (params: NetParams.PostGetPostComments) => {
return request({ return request({
method: 'get', method: 'get',
url: '/post/comments', url: '/post/comments',
params params
}); }) as unknown as Promise<NetReq.PostGetPostComments>;
}; };
/** /**
@ -112,12 +112,12 @@ export const getPostComments = (params: any) => {
* - @param {array} tags * - @param {array} tags
* @returns Promise * @returns Promise
*/ */
export const createPost = (data: any) => { export const createPost = (data: NetParams.PostCreatePost) => {
return request({ return request({
method: 'post', method: 'post',
url: '/post', url: '/post',
data data
}); }) as unknown as Promise<NetReq.PostCreatePost>;
}; };
/** /**
@ -140,12 +140,12 @@ export const deletePost = (data: any) => {
* - @param {number} id * - @param {number} id
* @returns Promise * @returns Promise
*/ */
export const lockPost = (data: any) => { export const lockPost = (data: NetParams.PostLockPost) => {
return request({ return request({
method: 'post', method: 'post',
url: '/post/lock', url: '/post/lock',
data data
}); }) as unknown as Promise<NetReq.PostLockPost>;
}; };
/** /**

@ -5,12 +5,12 @@ import request from '@/utils/request';
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getCaptcha = (params: any) => { export const getCaptcha = (params: NetParams.UserGetCaptcha = {}) => {
return request({ return request({
method: 'get', method: 'get',
url: '/captcha', url: '/captcha',
params params
}); }) as unknown as Promise<NetReq.UserGetCaptcha>;
}; };
/** /**
@ -31,12 +31,12 @@ export const sendCaptcha = (data: any) => {
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const bindUserPhone = (data: any) => { export const bindUserPhone = (data: NetParams.UserBindUserPhone) => {
return request({ return request({
method: 'post', method: 'post',
url: '/user/phone', url: '/user/phone',
data data
}); }) as unknown as Promise<NetParams.UserBindUserPhone>;
}; };
/** /**
@ -83,12 +83,12 @@ export const changeAvatar = (data: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getUnreadMsgCount = (params: any) => { export const getUnreadMsgCount = (params: NetParams.UserGetUnreadMsgCount = {}) => {
return request({ return request({
method: 'get', method: 'get',
url: '/user/msgcount/unread', url: '/user/msgcount/unread',
params params
}); }) as unknown as Promise<NetReq.UserGetUnreadMsgCount>;
}; };
/** /**
@ -96,12 +96,12 @@ export const getUnreadMsgCount = (params: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getMessages = (params: any) => { export const getMessages = (params: NetParams.UserGetMessages) => {
return request({ return request({
method: 'get', method: 'get',
url: '/user/messages', url: '/user/messages',
params params
}); }) as unknown as Promise<NetReq.UserGetMessages>;
}; };
/** /**
@ -122,7 +122,7 @@ export const readMessage = (data: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getCollections = (params: any) => { export const getCollections = (params: NetParams.UserGetCollections) => {
return request({ return request({
method: 'get', method: 'get',
url: '/user/collections', url: '/user/collections',
@ -135,12 +135,12 @@ export const getCollections = (params: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getStars = (params: any) => { export const getStars = (params: NetParams.UserGetStars) => {
return request({ return request({
method: 'get', method: 'get',
url: '/user/stars', url: '/user/stars',
params params
}); }) as unknown as Promise<NetReq.UserGetStars>;
}; };
/** /**
@ -148,12 +148,12 @@ export const getStars = (params: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getUserProfile = (params: any) => { export const getUserProfile = (params: NetParams.UserGetUserProfile) => {
return request({ return request({
method: 'get', method: 'get',
url: '/user/profile', url: '/user/profile',
params params
}); }) as unknown as Promise<NetReq.UserGetUserProfile>;
}; };
/** /**
@ -161,12 +161,12 @@ export const getUserProfile = (params: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getUserPosts = (params: any) => { export const getUserPosts = (params: NetParams.UserGetUserPosts) => {
return request({ return request({
method: 'get', method: 'get',
url: '/user/posts', url: '/user/posts',
params params
}); }) as unknown as Promise<NetReq.UserGetUserPosts>;
}; };
/** /**
@ -174,12 +174,12 @@ export const getUserPosts = (params: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getBills = (params: any) => { export const getBills = (params: NetParams.UserGetBills) => {
return request({ return request({
method: 'get', method: 'get',
url: '/user/wallet/bills', url: '/user/wallet/bills',
params params
}); }) as unknown as Promise<NetReq.UserGetBills>;
}; };
/** /**
@ -187,12 +187,12 @@ export const getBills = (params: any) => {
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const reqRecharge = (data: any) => { export const reqRecharge = (data: NetParams.UserReqRecharge) => {
return request({ return request({
method: 'post', method: 'post',
url: '/user/recharge', url: '/user/recharge',
data data
}); }) as unknown as Promise<NetReq.UserReqRecharge>;
}; };
/** /**
@ -200,12 +200,12 @@ export const reqRecharge = (data: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getRecharge = (params: any) => { export const getRecharge = (params: NetParams.UserGetRecharge) => {
return request({ return request({
method: 'get', method: 'get',
url: '/user/recharge', url: '/user/recharge',
params params
}); }) as unknown as Promise<NetReq.UserGetRecharge>;
}; };
/** /**
@ -239,12 +239,12 @@ export const getSuggestTags = (params: {k: string}) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const precheckAttachment = (params: any) => { export const precheckAttachment = (params: NetParams.UserPrecheckAttachment) => {
return request({ return request({
method: 'get', method: 'get',
url: '/attachment/precheck', url: '/attachment/precheck',
params params
}); }) as unknown as Promise<NetReq.UserPrecheckAttachment>;
}; };
/** /**
@ -252,10 +252,10 @@ export const precheckAttachment = (params: any) => {
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getAttachment = (params: any) => { export const getAttachment = (params: NetParams.UserGetAttachment) => {
return request({ return request({
method: 'get', method: 'get',
url: '/attachment', url: '/attachment',
params params
}); }) as unknown as Promise<NetReq.UserGetAttachment>;
}; };

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save