Skip to content

Commit

Permalink
fix: type structure
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsm-dev committed Jun 17, 2022
1 parent f48cad4 commit 4fd1206
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 32 deletions.
18 changes: 0 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,6 @@ install:
$(GO) install -x $(MAIN)
@echo ""

.PHONY: lint
lint:
@echo "==> Running lint..."
golint -set_exit_status ./...

.PHONY: test
test:
@echo "==> Running test..."
go test -v ./...

.PHONY: misspell
misspell:
@# misspell - Correct commonly misspelled English words in source files
@# go get -u github.com/client9/misspell/cmd/misspell
@echo "==> Runnig misspell ..."
find . -name '*.go' -not -path './vendor/*' -not -path './_repos/*' | xargs misspell -error
@echo ""

.PHONY: clean
clean:
@echo "==> Cleaning..."
Expand Down
30 changes: 16 additions & 14 deletions internal/types/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,31 @@ type AnimeTitle struct {
English string `json:"english"`
}

// Anime struct - information about the anime passed in the request to trace.moe API
type Anime struct {
// Anilist struct - information about the anime passed in the request to trace.moe API
type Anilist struct {
ID int `json:"id"`
IDMal int `json:"idMal"`
Title AnimeTitle `json:"title"`
Synonyms []string `json:"synonyms"`
IsAdult bool `json:"isAdult"`
}

type Anime struct {
Anilist Anilist `json:"anilist"`
Filename string `json:"filename"`
Episode int `json:"episode"`
From float32 `json:"from"`
To float32 `json:"to"`
Similarity float64 `json:"similarity"`
Video string `json:"video"`
Image string `json:"image"`
}

// Response struct - content of trace.moe API request result
type Response struct {
FrameCount int `json:"frameCount"`
Error string `json:"error"`
Result []struct {
Anilist Anime `json:"anilist"`
Filename string `json:"filename"`
Episode int `json:"episode"`
From float64 `json:"from"`
To float64 `json:"to"`
Similarity float64 `json:"similarity"`
Video string `json:"video"`
Image string `json:"image"`
} `json:"result"`
FrameCount int `json:"frameCount"`
Error string `json:"error"`
Result []Anime `json:"result"`
}

// UsageTraceMoe struct - content of request usage to trace moe
Expand Down

0 comments on commit 4fd1206

Please sign in to comment.