Skip to content

Commit

Permalink
upgrade:bluebell ==> bluebell-plus
Browse files Browse the repository at this point in the history
  • Loading branch information
mao888 committed Jul 14, 2023
1 parent be0de06 commit 74a40e5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
├── Makefile
├── README.md
├── bin
│   ├── bluebell
│   └── bluebell.conf
│   ├── bluebell-plus
│   └── bluebell-plus.conf
├── conf
│   └── config.yaml
├── controller
Expand Down Expand Up @@ -82,7 +82,7 @@
├── go.sum
├── init.sql
├── log
│   └── bluebell.log
│   └── bluebell-plus.log
├── logger
│   └── logger.go
├── logic
Expand Down Expand Up @@ -142,7 +142,7 @@
### 前端结构树
```bash
├── bin
│ └── bluebell
│ └── bluebell-plus
├── conf
│ └── config.yaml
├── static
Expand Down
6 changes: 3 additions & 3 deletions bluebell_backend/dao/mysql/post_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
"time"
)

func init() {
func init() {
dbCfg := settings.MySQLConfig{
Host: "127.0.0.1",
User: "root",
Password: "10428376",
DB: "bluebell",
DB: "bluebell-plus",
Port: 3306,
MaxOpenConns: 10,
MaxIdleConns: 10,
Expand All @@ -40,7 +40,7 @@ func TestCreatePost(t *testing.T) {
}
err := CreatePost(&post)
if err != nil {
t.Fatalf("CreatePost insert record into mysql failed, err:%v\n",err)
t.Fatalf("CreatePost insert record into mysql failed, err:%v\n", err)
}
t.Logf("CreatePost insert record into mysql success")
}
14 changes: 7 additions & 7 deletions bluebell_backend/dao/redis/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package redis

// redis key 注意使用命名空间的方式,方便查询和拆分
const (
KeyPostInfoHashPrefix = "bluebell:post:"
KeyPostTimeZSet = "bluebell:post:time" // zset;帖子及发帖时间定义
KeyPostScoreZSet = "bluebell:post:score" // zset;帖子及投票分数定义
//KeyPostVotedUpSetPrefix = "bluebell:post:voted:down:"
//KeyPostVotedDownSetPrefix = "bluebell:post:voted:up:"
KeyPostVotedZSetPrefix = "bluebell:post:voted:" // zSet;记录用户及投票类型;参数是post_id
KeyCommunityPostSetPrefix = "bluebell:community:" // set保存每个分区下帖子的id
KeyPostInfoHashPrefix = "bluebell-plus:post:"
KeyPostTimeZSet = "bluebell-plus:post:time" // zset;帖子及发帖时间定义
KeyPostScoreZSet = "bluebell-plus:post:score" // zset;帖子及投票分数定义
//KeyPostVotedUpSetPrefix = "bluebell-plus:post:voted:down:"
//KeyPostVotedDownSetPrefix = "bluebell-plus:post:voted:up:"
KeyPostVotedZSetPrefix = "bluebell-plus:post:voted:" // zSet;记录用户及投票类型;参数是post_id
KeyCommunityPostSetPrefix = "bluebell-plus:community:" // set保存每个分区下帖子的id
)
2 changes: 1 addition & 1 deletion bluebell_backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
command: "--default-authentication-plugin=mysql_native_password --init-file /data/application/init.sql" # 初始化命令
environment:
MYSQL_ROOT_PASSWORD: "root1234"
MYSQL_DATABASE: "bluebell"
MYSQL_DATABASE: "bluebell-plus"
MYSQL_PASSWORD: "root1234"
volumes:
- ./init.sql:/data/application/init.sql
Expand Down
2 changes: 1 addition & 1 deletion bluebell_backend/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Source Server Type : MySQL
Source Server Version : 50719
Source Host : localhost:3306
Source Schema : bluebell
Source Schema : bluebell-plus
Target Server Type : MySQL
Target Server Version : 50719
Expand Down
6 changes: 3 additions & 3 deletions bluebell_backend/pkg/jwt/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type MyClaims struct {
}

//定义Secret 用于加密的字符串
var mySecret = []byte("bluebell")
var mySecret = []byte("bluebell-plus")

func keyFunc(_ *jwt.Token) (i interface{}, err error) {
return mySecret, nil
Expand All @@ -39,7 +39,7 @@ func GenToken(userID uint64, username string) (aToken, rToken string, err error)
username, // 自定义字段
jwt.StandardClaims{ // JWT规定的7个官方字段
ExpiresAt: time.Now().Add(AccessTokenExpireDuration).Unix(), // 过期时间
Issuer: "bluebell", // 签发人
Issuer: "bluebell-plus", // 签发人
},
}
// 加密并获得完整的编码后的字符串token
Expand All @@ -48,7 +48,7 @@ func GenToken(userID uint64, username string) (aToken, rToken string, err error)
// refresh token 不需要存任何自定义数据
rToken, err = jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.StandardClaims{
ExpiresAt: time.Now().Add(RefreshTokenExpireDuration).Unix(), // 过期时间
Issuer: "bluebell", // 签发人
Issuer: "bluebell-plus", // 签发人
}).SignedString(mySecret)
// 使用指定的secret签名并获得完整的编码后的字符串token
return
Expand Down

0 comments on commit 74a40e5

Please sign in to comment.