Merge pull request #13 from nightbug-xx/bn52dv-codex/add-from_user_email-to-response
Add friend emails to listing
This commit is contained in:
commit
40ae7dfc4a
@ -76,6 +76,7 @@ def update_character(
|
|||||||
character.name = req.name
|
character.name = req.name
|
||||||
character.server = req.server
|
character.server = req.server
|
||||||
character.combat_power = req.power
|
character.combat_power = req.power
|
||||||
|
character.is_public = req.is_public
|
||||||
db.commit()
|
db.commit()
|
||||||
return {"message": "캐릭터가 수정되었습니다."}
|
return {"message": "캐릭터가 수정되었습니다."}
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,7 @@ def register_homework_type(
|
|||||||
reset_type=homework_data.reset_type,
|
reset_type=homework_data.reset_type,
|
||||||
reset_time=homework_data.reset_time or time(6, 0),
|
reset_time=homework_data.reset_time or time(6, 0),
|
||||||
clear_count=homework_data.clear_count or 0,
|
clear_count=homework_data.clear_count or 0,
|
||||||
|
is_public=homework_data.is_public,
|
||||||
created_at=datetime.utcnow(),
|
created_at=datetime.utcnow(),
|
||||||
)
|
)
|
||||||
db.add(homework_type)
|
db.add(homework_type)
|
||||||
@ -56,6 +57,7 @@ def update_homework_type(
|
|||||||
homework_type.description = req.description
|
homework_type.description = req.description
|
||||||
homework_type.reset_type = req.reset_type
|
homework_type.reset_type = req.reset_type
|
||||||
homework_type.clear_count = req.clear_count
|
homework_type.clear_count = req.clear_count
|
||||||
|
homework_type.is_public = req.is_public
|
||||||
|
|
||||||
db.commit()
|
db.commit()
|
||||||
return {"message": "숙제가 수정되었습니다."}
|
return {"message": "숙제가 수정되었습니다."}
|
||||||
|
|||||||
@ -21,6 +21,7 @@ def create_character(user_id: int, character_data: CharacterCreate, db: Session)
|
|||||||
server=character_data.server,
|
server=character_data.server,
|
||||||
job=character_data.job,
|
job=character_data.job,
|
||||||
combat_power=character_data.combat_power, # ← 수동 입력 허용
|
combat_power=character_data.combat_power, # ← 수동 입력 허용
|
||||||
|
is_public=character_data.is_public,
|
||||||
created_at=datetime.utcnow(),
|
created_at=datetime.utcnow(),
|
||||||
updated_at=datetime.utcnow(),
|
updated_at=datetime.utcnow(),
|
||||||
)
|
)
|
||||||
|
|||||||
@ -10,6 +10,7 @@ def create_homework_type(user_id: int, data: HomeworkTypeCreate, db: Session):
|
|||||||
reset_type=data.reset_type,
|
reset_type=data.reset_type,
|
||||||
reset_time=data.reset_time,
|
reset_time=data.reset_time,
|
||||||
clear_count=data.clear_count,
|
clear_count=data.clear_count,
|
||||||
|
is_public=data.is_public,
|
||||||
)
|
)
|
||||||
db.add(new_homework)
|
db.add(new_homework)
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|||||||
@ -10,6 +10,7 @@ class CharacterCreate(BaseModel):
|
|||||||
server: Optional[str] = None
|
server: Optional[str] = None
|
||||||
job: Optional[str] = None
|
job: Optional[str] = None
|
||||||
combat_power: Optional[int] = None # ← 추가
|
combat_power: Optional[int] = None # ← 추가
|
||||||
|
is_public: bool = False
|
||||||
|
|
||||||
# 캐릭터 응답용
|
# 캐릭터 응답용
|
||||||
class CharacterResponse(BaseModel):
|
class CharacterResponse(BaseModel):
|
||||||
@ -18,6 +19,7 @@ class CharacterResponse(BaseModel):
|
|||||||
server: Optional[str]
|
server: Optional[str]
|
||||||
job: Optional[str]
|
job: Optional[str]
|
||||||
combat_power: Optional[int] # ← 추가
|
combat_power: Optional[int] # ← 추가
|
||||||
|
is_public: bool
|
||||||
auto_synced_at: Optional[datetime]
|
auto_synced_at: Optional[datetime]
|
||||||
created_at: datetime
|
created_at: datetime
|
||||||
|
|
||||||
@ -28,6 +30,7 @@ class CharacterUpdateRequest(BaseModel):
|
|||||||
name: constr(min_length=1)
|
name: constr(min_length=1)
|
||||||
server: constr(min_length=1)
|
server: constr(min_length=1)
|
||||||
power: conint(ge=0) # 0 이상 정수
|
power: conint(ge=0) # 0 이상 정수
|
||||||
|
is_public: bool
|
||||||
|
|
||||||
class CharacterDetailResponse(BaseModel):
|
class CharacterDetailResponse(BaseModel):
|
||||||
id: int
|
id: int
|
||||||
@ -35,6 +38,7 @@ class CharacterDetailResponse(BaseModel):
|
|||||||
server: str
|
server: str
|
||||||
combat_power: int
|
combat_power: int
|
||||||
user_id: int
|
user_id: int
|
||||||
|
is_public: bool
|
||||||
created_at: datetime
|
created_at: datetime
|
||||||
updated_at: datetime
|
updated_at: datetime
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@ class HomeworkTypeCreate(BaseModel):
|
|||||||
reset_type: str
|
reset_type: str
|
||||||
reset_time: Optional[time] = None
|
reset_time: Optional[time] = None
|
||||||
clear_count: Optional[int] = 0
|
clear_count: Optional[int] = 0
|
||||||
|
is_public: bool = False
|
||||||
|
|
||||||
class HomeworkTypeResponse(BaseModel):
|
class HomeworkTypeResponse(BaseModel):
|
||||||
id: int
|
id: int
|
||||||
@ -18,6 +19,7 @@ class HomeworkTypeResponse(BaseModel):
|
|||||||
reset_type: str
|
reset_type: str
|
||||||
reset_time: time
|
reset_time: time
|
||||||
clear_count: int
|
clear_count: int
|
||||||
|
is_public: bool
|
||||||
created_at: datetime
|
created_at: datetime
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
@ -35,6 +37,7 @@ class HomeworkTypeUpdateRequest(BaseModel):
|
|||||||
description: str | None = None
|
description: str | None = None
|
||||||
reset_type: constr(min_length=1)
|
reset_type: constr(min_length=1)
|
||||||
clear_count: conint(ge=1)
|
clear_count: conint(ge=1)
|
||||||
|
is_public: bool
|
||||||
|
|
||||||
class HomeworkTypeDetailResponse(BaseModel):
|
class HomeworkTypeDetailResponse(BaseModel):
|
||||||
id: int
|
id: int
|
||||||
@ -44,6 +47,7 @@ class HomeworkTypeDetailResponse(BaseModel):
|
|||||||
reset_type: str
|
reset_type: str
|
||||||
reset_time: time
|
reset_time: time
|
||||||
clear_count: int
|
clear_count: int
|
||||||
|
is_public: bool
|
||||||
created_at: datetime
|
created_at: datetime
|
||||||
|
|
||||||
model_config = {
|
model_config = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user