Skip to content

Commit

Permalink
Merge branch 'dev' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkinStars committed Jan 16, 2025
2 parents 8a33548 + 581f73c commit 3811b43
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
2 changes: 0 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ archives:
dst: NOTICE
- src: "docs/release/licenses/*"
dst: licenses/
- src: "DISCLAIMER"
dst: DISCLAIMER
wrap_in_directory: true
checksum:
name_template: 'checksums.txt'
Expand Down
10 changes: 0 additions & 10 deletions DISCLAIMER

This file was deleted.

4 changes: 0 additions & 4 deletions internal/controller/answer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,6 @@ func (ac *AnswerController) Add(ctx *gin.Context) {
objectOwner := ac.rankService.CheckOperationObjectOwner(ctx, req.UserID, info.ID)
req.CanEdit = canList[0] || objectOwner
req.CanDelete = canList[1] || objectOwner
if !can {
handler.HandleResponse(ctx, errors.Forbidden(reason.RankFailToMeetTheCondition), nil)
return
}
info.MemberActions = permission.GetAnswerPermission(ctx, req.UserID, info.UserID,
0, req.CanEdit, req.CanDelete, false)
handler.HandleResponse(ctx, nil, gin.H{
Expand Down
6 changes: 3 additions & 3 deletions pkg/uid/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ type SnowFlakeID struct {
var snowFlakeIDGenerator *SnowFlakeID

func init() {
// todo
rand.Seed(time.Now().UnixNano())
node, err := snowflake.NewNode(int64(rand.Intn(1000)) + 1)
source := rand.NewSource(time.Now().UnixNano())
r := rand.New(source)
node, err := snowflake.NewNode(int64(r.Intn(1000)) + 1)
if err != nil {
panic(err.Error())
}
Expand Down

0 comments on commit 3811b43

Please sign in to comment.