Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ close #

## 動作確認

<deatils><summary>エビデンス</summary></details>

## テスト結果
2 changes: 2 additions & 0 deletions .github/workflows/batch-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Batch Deploy

on:
push:
branches:
- main

env:
JOB_NAME: mh-api-batch
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/ci.yml

This file was deleted.

28 changes: 17 additions & 11 deletions .github/workflows/test.yml → .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
name: Test
name: lint and test
on:
push:
pull_request:
branches:
- "main"
paths:
- "**.go"
- .github/workflows/test.yml
pull_request:
paths:
- "**.go"
- .github/workflows/test.yml

jobs:
golang-test:
lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
golangci_lint_flags: "--timeout=5m --config=./.golangci.yml ./..."
fail_on_error: true
reporter: "github-pr-review"

test:
name: test
runs-on: ubuntu-latest
steps:
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/scenario_test.yml

This file was deleted.

11 changes: 8 additions & 3 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- main
paths:
- ".github/workflows/spec.yml"
- "doc/openapi/swagger.yaml"

jobs:
build:
Expand All @@ -22,6 +19,14 @@ jobs:
- name: Check out
uses: actions/checkout@v3

- name: Install swaggo
run: |
go install github.com/swaggo/swag/cmd/swag@latest

- name: Generate OpenAPI Spec
run: |
swag init -g app/cmd/api/main.go --output doc/openapi/

- name: Build ReDoc HTML
run: |
npm install -g redoc-cli
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ linters-settings:
min-complexity: 30
misspell:
locale: US
skip-files:
- app/internal/**/*_test.go


linters:
disable-all: true
Expand Down
19 changes: 19 additions & 0 deletions app/internal/DI/bgm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package di

import (
"context"
handler "mh-api/app/internal/controller/music"
musicDriver "mh-api/app/internal/driver/music"
"mh-api/app/internal/driver/mysql"
"mh-api/app/internal/service/music"
)

func InitBGMHandler() *handler.BGMHandler {
db := mysql.New(context.Background())
repo := musicDriver.NewMusicRepository(db)
qs := musicDriver.NewmusicQueryService(db)
service := music.NewMusicService(repo, qs)
handler := handler.NewBGMHandler(*service)

return handler
}
2 changes: 1 addition & 1 deletion app/internal/batch/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func BatchDI() *BatchService {
db := mysql.New(context.Background())
Monsterrepo := monsterDriver.NewMonsterRepository(db)
Fieldrepo := fieldDriver.NewfieldRepository(db)
Musicrepo := musicDriver.NewmusicRepository(db)
Musicrepo := musicDriver.NewMusicRepository(db)
Itemrepo := itemDriver.NewMonsterRepository(db)
Partrepo := partDriver.NewMonsterRepository(db)
Productrepo := productDriver.NewMonsterRepository(db)
Expand Down
4 changes: 2 additions & 2 deletions app/internal/controller/monster/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ func (m *MonsterHandler) GetAll(c *gin.Context) {
return
}

id, ook := c.Params.Get("id")
if ook {
id, ok := c.Params.Get("id")
if ok {
id = ""
}
ctx := context.WithValue(c.Request.Context(), "param", param)
Expand Down
Loading