Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

出席管理APIのルート構造改善とSwagger文書の強化 #355

Merged
merged 1 commit into from
Nov 11, 2024
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
8 changes: 4 additions & 4 deletions controllers/attendance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewAttendanceController(service services.AttendanceService) *AttendanceCont
// @Failure 400 {object} ErrorResponse
// @Failure 401 {object} ErrorResponse
// @Failure 500 {object} ErrorResponse
// @Router /api/gin/attendances [post]
// @Router /attendances [post]
func (ac *AttendanceController) CreateOrUpdateAttendances(ctx *gin.Context) {
var attendances []AttendanceInput
if err := ctx.ShouldBindJSON(&attendances); err != nil {
Expand Down Expand Up @@ -93,7 +93,7 @@ func (ac *AttendanceController) CreateOrUpdateAttendances(ctx *gin.Context) {
// @Failure 401 {object} ErrorResponse
// @Failure 404 {object} ErrorResponse
// @Failure 500 {object} ErrorResponse
// @Router /api/gin/attendances/class/{classId} [get]
// @Router /attendances/class/{classId} [get]
func (ac *AttendanceController) GetAttendancesByClass(ctx *gin.Context) {
classId, err := strconv.ParseUint(ctx.Param("classId"), 10, 32)
if err != nil {
Expand Down Expand Up @@ -129,7 +129,7 @@ func (ac *AttendanceController) GetAttendancesByClass(ctx *gin.Context) {
// @Failure 401 {object} ErrorResponse
// @Failure 404 {object} ErrorResponse
// @Failure 500 {object} ErrorResponse
// @Router /api/gin/attendances/schedule/{scheduleId} [get]
// @Router /attendances/schedule/{scheduleId} [get]
func (ac *AttendanceController) GetAttendancesBySchedule(ctx *gin.Context) {
scheduleId, err := strconv.ParseUint(ctx.Param("scheduleId"), 10, 32)
if err != nil {
Expand Down Expand Up @@ -165,7 +165,7 @@ func (ac *AttendanceController) GetAttendancesBySchedule(ctx *gin.Context) {
// @Failure 401 {object} ErrorResponse
// @Failure 404 {object} ErrorResponse
// @Failure 500 {object} ErrorResponse
// @Router /api/gin/attendances/{id} [delete]
// @Router /attendances/{id} [delete]
func (ac *AttendanceController) DeleteAttendance(ctx *gin.Context) {
id, err := strconv.ParseUint(ctx.Param("id"), 10, 32)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/gin/attendances": {
"/attendances": {
"post": {
"security": [
{
Expand Down Expand Up @@ -78,7 +78,7 @@ const docTemplate = `{
}
}
},
"/api/gin/attendances/class/{classId}": {
"/attendances/class/{classId}": {
"get": {
"description": "全ての出席情報を取得する。",
"consumes": [
Expand Down Expand Up @@ -141,7 +141,7 @@ const docTemplate = `{
}
}
},
"/api/gin/attendances/schedule/{scheduleId}": {
"/attendances/schedule/{scheduleId}": {
"get": {
"security": [
{
Expand Down Expand Up @@ -202,7 +202,7 @@ const docTemplate = `{
}
}
},
"/api/gin/attendances/{id}": {
"/attendances/{id}": {
"delete": {
"security": [
{
Expand Down
8 changes: 4 additions & 4 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"contact": {}
},
"paths": {
"/api/gin/attendances": {
"/attendances": {
"post": {
"security": [
{
Expand Down Expand Up @@ -67,7 +67,7 @@
}
}
},
"/api/gin/attendances/class/{classId}": {
"/attendances/class/{classId}": {
"get": {
"description": "全ての出席情報を取得する。",
"consumes": [
Expand Down Expand Up @@ -130,7 +130,7 @@
}
}
},
"/api/gin/attendances/schedule/{scheduleId}": {
"/attendances/schedule/{scheduleId}": {
"get": {
"security": [
{
Expand Down Expand Up @@ -191,7 +191,7 @@
}
}
},
"/api/gin/attendances/{id}": {
"/attendances/{id}": {
"delete": {
"security": [
{
Expand Down
8 changes: 4 additions & 4 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ definitions:
info:
contact: {}
paths:
/api/gin/attendances:
/attendances:
post:
consumes:
- application/json
Expand Down Expand Up @@ -270,7 +270,7 @@ paths:
summary: 出席情報を作成または更新
tags:
- Attendance
/api/gin/attendances/{id}:
/attendances/{id}:
delete:
consumes:
- application/json
Expand Down Expand Up @@ -311,7 +311,7 @@ paths:
summary: IDで出席情報を削除
tags:
- Attendance
/api/gin/attendances/class/{classId}:
/attendances/class/{classId}:
get:
consumes:
- application/json
Expand Down Expand Up @@ -353,7 +353,7 @@ paths:
summary: 全ての出席情報を取得
tags:
- Attendance
/api/gin/attendances/schedule/{scheduleId}:
/attendances/schedule/{scheduleId}:
get:
consumes:
- application/json
Expand Down
Loading