feat: Swagger API 문서 추가 + 보스레이드/플레이어 레벨 시스템
- swaggo/swag 기반 전체 API 엔드포인트 Swagger 어노테이션 (59개) - /swagger/ 경로에 Swagger UI 제공 - 보스레이드 데디서버 관리 (등록, 하트비트, 슬롯 리셋) - 플레이어 레벨/경험치 시스템 및 스탯 성장 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,16 @@ func NewHandler(svc *Service) *Handler {
|
||||
return &Handler{svc: svc}
|
||||
}
|
||||
|
||||
// GetAll godoc
|
||||
// @Summary 공지사항 목록 조회
|
||||
// @Description 공지사항 목록을 조회합니다
|
||||
// @Tags Announcements
|
||||
// @Produce json
|
||||
// @Param offset query int false "시작 위치" default(0)
|
||||
// @Param limit query int false "조회 수" default(20)
|
||||
// @Success 200 {array} docs.AnnouncementResponse
|
||||
// @Failure 500 {object} docs.ErrorResponse
|
||||
// @Router /api/announcements/ [get]
|
||||
func (h *Handler) GetAll(c *fiber.Ctx) error {
|
||||
offset := c.QueryInt("offset", 0)
|
||||
limit := c.QueryInt("limit", 20)
|
||||
@@ -32,6 +42,20 @@ func (h *Handler) GetAll(c *fiber.Ctx) error {
|
||||
return c.JSON(list)
|
||||
}
|
||||
|
||||
// Create godoc
|
||||
// @Summary 공지사항 생성 (관리자)
|
||||
// @Description 새 공지사항을 생성합니다
|
||||
// @Tags Announcements
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
// @Param body body docs.CreateAnnouncementRequest true "공지사항 내용"
|
||||
// @Success 201 {object} docs.AnnouncementResponse
|
||||
// @Failure 400 {object} docs.ErrorResponse
|
||||
// @Failure 401 {object} docs.ErrorResponse
|
||||
// @Failure 403 {object} docs.ErrorResponse
|
||||
// @Failure 500 {object} docs.ErrorResponse
|
||||
// @Router /api/announcements/ [post]
|
||||
func (h *Handler) Create(c *fiber.Ctx) error {
|
||||
var body struct {
|
||||
Title string `json:"title"`
|
||||
@@ -53,6 +77,22 @@ func (h *Handler) Create(c *fiber.Ctx) error {
|
||||
return c.Status(fiber.StatusCreated).JSON(a)
|
||||
}
|
||||
|
||||
// Update godoc
|
||||
// @Summary 공지사항 수정 (관리자)
|
||||
// @Description 공지사항을 수정합니다
|
||||
// @Tags Announcements
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
// @Param id path int true "공지사항 ID"
|
||||
// @Param body body docs.UpdateAnnouncementRequest true "수정할 내용"
|
||||
// @Success 200 {object} docs.AnnouncementResponse
|
||||
// @Failure 400 {object} docs.ErrorResponse
|
||||
// @Failure 401 {object} docs.ErrorResponse
|
||||
// @Failure 403 {object} docs.ErrorResponse
|
||||
// @Failure 404 {object} docs.ErrorResponse
|
||||
// @Failure 500 {object} docs.ErrorResponse
|
||||
// @Router /api/announcements/{id} [put]
|
||||
func (h *Handler) Update(c *fiber.Ctx) error {
|
||||
id, err := strconv.ParseUint(c.Params("id"), 10, 64)
|
||||
if err != nil {
|
||||
@@ -85,6 +125,19 @@ func (h *Handler) Update(c *fiber.Ctx) error {
|
||||
return c.JSON(a)
|
||||
}
|
||||
|
||||
// Delete godoc
|
||||
// @Summary 공지사항 삭제 (관리자)
|
||||
// @Description 공지사항을 삭제합니다
|
||||
// @Tags Announcements
|
||||
// @Security BearerAuth
|
||||
// @Param id path int true "공지사항 ID"
|
||||
// @Success 204
|
||||
// @Failure 400 {object} docs.ErrorResponse
|
||||
// @Failure 401 {object} docs.ErrorResponse
|
||||
// @Failure 403 {object} docs.ErrorResponse
|
||||
// @Failure 404 {object} docs.ErrorResponse
|
||||
// @Failure 500 {object} docs.ErrorResponse
|
||||
// @Router /api/announcements/{id} [delete]
|
||||
func (h *Handler) Delete(c *fiber.Ctx) error {
|
||||
id, err := strconv.ParseUint(c.Params("id"), 10, 64)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user