Skip to content

Commit ccb521b

Browse files
authored
Merge pull request #1 from themoment-team/feature/club-status-and-year-fields
[update] 동아리 운영 상태 및 학년도 관련 필드 추가
2 parents 09965a0 + 0c26d6e commit ccb521b

7 files changed

Lines changed: 33 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "datagsm-openapi-sdk"
7-
version = "1.0.1"
7+
version = "1.0.2"
88
description = "Python SDK for DataGSM OpenAPI"
99
readme = "README.md"
1010
requires-python = ">=3.9"

src/datagsm_openapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
ValidationException,
3737
)
3838

39-
__version__ = "0.1.0"
39+
__version__ = "1.0.2"
4040

4141
__all__ = [
4242
"BadRequestException",

src/datagsm_openapi/_http.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import httpx
66

7+
from . import __version__
78
from .exceptions import (
89
BadRequestException,
910
DataGsmException,
@@ -68,7 +69,7 @@ def _get_headers(self) -> dict[str, str]:
6869
return {
6970
"X-API-KEY": self.api_key,
7071
"Accept": "application/json",
71-
"User-Agent": "datagsm-openapi-sdk-python/0.1.0",
72+
"User-Agent": f"datagsm-openapi-sdk-python/{__version__}",
7273
}
7374

7475
def _get_client(self) -> httpx.Client:

src/datagsm_openapi/api/club.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from dataclasses import dataclass
44
from typing import Optional
55

6-
from ..models import ClubDetail, ClubResponse, ClubSortBy, ClubType, SortDirection
6+
from ..models import ClubDetail, ClubResponse, ClubSortBy, ClubStatus, ClubType, SortDirection
77
from ._base import BaseApi
88

99

@@ -14,7 +14,8 @@ class ClubRequest:
1414
Attributes:
1515
club_id: Club ID for exact match
1616
club_name: Club name for filtering
17-
club_type: Club type filter (MAJOR_CLUB, JOB_CLUB, AUTONOMOUS_CLUB)
17+
club_type: Club type filter (MAJOR_CLUB, AUTONOMOUS_CLUB)
18+
status: Club operation status filter (ACTIVE, ABOLISHED)
1819
page: Page number (default: 0)
1920
size: Page size (default: 100)
2021
include_leader_in_participants: Include leader in participants list (default: False)
@@ -25,6 +26,7 @@ class ClubRequest:
2526
club_id: Optional[int] = None
2627
club_name: Optional[str] = None
2728
club_type: Optional[ClubType] = None
29+
status: Optional[ClubStatus] = None
2830
page: int = 0
2931
size: int = 100
3032
include_leader_in_participants: bool = False
@@ -41,6 +43,7 @@ def to_params(self) -> dict[str, Optional[object]]:
4143
"clubId": self.club_id,
4244
"clubName": self.club_name,
4345
"clubType": self.club_type.value if self.club_type else None,
46+
"status": self.status.value if self.status else None,
4447
"page": self.page,
4548
"size": self.size,
4649
"includeLeaderInParticipants": self.include_leader_in_participants,

src/datagsm_openapi/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from .club import Club, ClubDetail, ClubResponse
55
from .enums import (
66
ClubSortBy,
7+
ClubStatus,
78
ClubType,
89
Major,
910
MealType,
@@ -22,6 +23,7 @@
2223
"ClubDetail",
2324
"ClubResponse",
2425
"ClubSortBy",
26+
"ClubStatus",
2527
"ClubType",
2628
"CommonApiResponse",
2729
"Major",

src/datagsm_openapi/models/club.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""Club-related models for DataGSM OpenAPI SDK."""
22

3-
from typing import TYPE_CHECKING
3+
from typing import TYPE_CHECKING, Optional
44

55
from pydantic import BaseModel, ConfigDict, Field
66

7-
from .enums import ClubType
7+
from .enums import ClubStatus, ClubType
88

99
if TYPE_CHECKING:
1010
from .project import ParticipantInfo
@@ -37,13 +37,23 @@ class ClubDetail(BaseModel):
3737
id: Club ID
3838
name: Club name
3939
type: Club type
40+
status: Club operation status (ACTIVE or ABOLISHED)
41+
founded_year: Year the club was founded
42+
abolished_year: Year the club was abolished (None if still active)
4043
leader: Club leader information
4144
participants: List of club members
4245
"""
4346

4447
id: int = Field(..., description="Club ID")
4548
name: str = Field(..., description="Club name")
4649
type: ClubType = Field(..., description="Club type")
50+
status: Optional[ClubStatus] = Field(None, description="Club operation status")
51+
founded_year: Optional[int] = Field(
52+
None, alias="foundedYear", description="Year the club was founded"
53+
)
54+
abolished_year: Optional[int] = Field(
55+
None, alias="abolishedYear", description="Year the club was abolished"
56+
)
4757
leader: "ParticipantInfo" = Field(..., description="Club leader")
4858
participants: list["ParticipantInfo"] = Field(
4959
default_factory=list, description="Club members"

src/datagsm_openapi/models/enums.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,22 @@ class StudentSortBy(str, Enum):
6666
DORMITORY_ROOM = "DORMITORY_ROOM"
6767

6868

69+
class ClubStatus(str, Enum):
70+
"""동아리 운영 상태 (Club Status)."""
71+
72+
ACTIVE = "ACTIVE"
73+
ABOLISHED = "ABOLISHED"
74+
75+
6976
class ClubSortBy(str, Enum):
7077
"""동아리 정렬 기준 (Club Sort By)."""
7178

7279
ID = "ID"
7380
NAME = "NAME"
7481
TYPE = "TYPE"
82+
FOUNDED_YEAR = "FOUNDED_YEAR"
83+
ABOLISHED_YEAR = "ABOLISHED_YEAR"
84+
STATUS = "STATUS"
7585

7686

7787
class ProjectSortBy(str, Enum):

0 commit comments

Comments
 (0)