Skip to content

Commit

Permalink
Merge pull request #14 from tomoish/character
Browse files Browse the repository at this point in the history
Character画像生成のハンドラー追加
  • Loading branch information
kou7306 authored Jan 31, 2024
2 parents 63795a0 + c78b73a commit 4bf9973
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/funcs/funcs_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ package funcs
// バイト情報から画像をファイルに保存する関数
// SaveImage(filename string, imgBytes []byte) error
// }


Check failure on line 28 in src/funcs/funcs_interface.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofmt`-ed with `-s` (gofmt)
// コントリビューションの合計と日毎のコントリビューション数を取得する関数
// GetLongestStreak(username string) (int, error)


1 change: 1 addition & 0 deletions src/funcs/get_commit_streak.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type response struct {
} `json:"data"`
}


Check failure on line 47 in src/funcs/get_commit_streak.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofmt`-ed with `-s` (gofmt)
func calculateStreak(weeks []struct {
ContributionDays []struct {
ContributionCount int `json:"contributionCount"`
Expand Down
Binary file modified src/funcs/images/language.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func getLanguageHandler(w http.ResponseWriter, r *http.Request) {
CreateLanguageImg()
}

func getCharacterHandler(w http.ResponseWriter, r *http.Request) {
CreateCharacterImg()
}

func getCommitStreakHandler(w http.ResponseWriter, r *http.Request) {

queryValues := r.URL.Query()
Expand All @@ -60,6 +64,7 @@ func main() {
http.HandleFunc("/test", handler)
http.HandleFunc("/streak", getCommitStreakHandler)
http.HandleFunc("/language", getLanguageHandler)
http.HandleFunc("/character", getCharacterHandler)
fmt.Println("Hello, World!")
err := http.ListenAndServe(":8080", nil)
if err != nil {
Expand Down

0 comments on commit 4bf9973

Please sign in to comment.