Skip to content

Commit

Permalink
Merge pull request #119 from traP-jp/fix/favoritecount
Browse files Browse the repository at this point in the history
compact
  • Loading branch information
kavos113 authored Sep 4, 2024
2 parents fd54457 + 3a5f16c commit 62d9ddf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/shogo82148/go-mecab v0.0.8
github.com/traPtitech/go-traq v0.0.0-20240725071454-97c7b85dc879
github.com/traPtitech/traq-ws-bot v1.1.3
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948
)

require (
Expand Down
6 changes: 4 additions & 2 deletions src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
Expand Down Expand Up @@ -99,6 +99,8 @@ go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w=
golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA=
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=
golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
4 changes: 3 additions & 1 deletion src/handler/wikiHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"database/sql"
"errors"
"github.com/labstack/echo"
"golang.org/x/exp/slices"
"log"
"net/http"
"quickwiki-backend/model"
Expand Down Expand Up @@ -165,7 +166,7 @@ func WikiIdToResponse(h *Handler, c echo.Context, wikiIds []int) error {
tmpSearchContent.ID = wikiId
tmpSearchContent.Type = wikiContent.Type
tmpSearchContent.Title = wikiContent.Name
tmpSearchContent.Abstract = firstTenChars(wikiContent.Content, 20) //Abstractを入れるべき
tmpSearchContent.Abstract = firstTenChars(wikiContent.Content, 50) //Abstractを入れるべき
tmpSearchContent.CreatedAt = wikiContent.CreatedAt
tmpSearchContent.UpdatedAt = wikiContent.UpdatedAt
tmpSearchContent.OwnerTraqID = wikiContent.OwnerTraqID
Expand Down Expand Up @@ -309,6 +310,7 @@ func (h *Handler) GetWikiByTagHandler(c echo.Context) error {
searchResultWikiIds[i] = append(searchResultWikiIds[i], tag.WikiID)
}

searchResultWikiIds[i] = slices.Compact(searchResultWikiIds[i])
}
log.Println("searchResultWikiIds : ", searchResultWikiIds)

Expand Down

0 comments on commit 62d9ddf

Please sign in to comment.