Skip to content

Commit

Permalink
Merge pull request #7 from Polyisoprene/master
Browse files Browse the repository at this point in the history
MERGE
  • Loading branch information
Polyisoprene authored Feb 23, 2024
2 parents 2e90a1f + 7d4b7c4 commit 99a37d6
Show file tree
Hide file tree
Showing 14 changed files with 583 additions and 751 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
shell: bash

- name : Install dependance
run: poetry install --without dev
run: poetry install
shell: bash

- name : Build dist
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
.git
.github
dist
sample.py
dynamicadaptor/__pycache__
52 changes: 27 additions & 25 deletions dynamicadaptor/AddonCard.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from enum import Enum
from typing import List, Optional, Union
from typing import List, Optional
from pydantic import BaseModel


Expand All @@ -9,7 +8,6 @@ class GoodsItem(BaseModel):
price: str
name: str



class Goods(BaseModel):
head_text: str
Expand All @@ -25,16 +23,16 @@ class Reserve(BaseModel):
title: str
desc1: ReserveDesc
desc2: ReserveDesc
desc3: Optional[ReserveDesc]
desc3: Optional[ReserveDesc] = None


# Common
class Common(BaseModel):
sub_type: str
head_text: Optional[str]
head_text: Optional[str] = None
cover: str
desc1: str
desc2: Optional[str]
desc2: Optional[str] = None
title: str


Expand All @@ -44,29 +42,32 @@ class Ugc(BaseModel):
title: str
desc_second: str
duration: str
head_text: Optional[str]
head_text: Optional[str] = None


# Vote
class Vote(BaseModel):
desc: Optional[str]
join_num: Optional[int]

desc: Optional[str] = None
join_num: Optional[int] = None


class UpowerLotteryBtnJst(BaseModel):
text:str
text: str


class UpowerLotteryDesc(BaseModel):
text:str
text: str


class UpowerLotteryBtn(BaseModel):
jump_style:Optional[UpowerLotteryBtnJst]
jump_style: Optional[UpowerLotteryBtnJst] = None


class UpowerLottery(BaseModel):
title:str
desc:UpowerLotteryDesc
button:UpowerLotteryBtn
title: str
desc: UpowerLotteryDesc
button: UpowerLotteryBtn


# class AdditionalDetail(Enum):
# """
Expand All @@ -86,14 +87,15 @@ class UpowerLottery(BaseModel):
# reserve: Reserve
# common: Common
# ugc: Ugc
# vote: Vote
# upower_lottery:UpowerLottery
# vote: Vote
# upower_lottery:UpowerLottery


class Additional(BaseModel):
type: str
goods: Optional[Goods]
reserve: Optional[Reserve]
common: Optional[Common]
ugc: Optional[Ugc]
vote: Optional[Vote]
upower_lottery:Optional[UpowerLottery]
goods: Optional[Goods] = None
reserve: Optional[Reserve] = None
common: Optional[Common] = None
ugc: Optional[Ugc] = None
vote: Optional[Vote] = None
upower_lottery: Optional[UpowerLottery] = None
19 changes: 8 additions & 11 deletions dynamicadaptor/Content.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@


class Emoji(BaseModel):
icon_url: Optional[str]
text: Optional[str]
type: Union[int, str, None]



icon_url: Optional[str] = None
text: Optional[str] = None
type: Union[int, str, None] = None


class RichTextDetail(BaseModel):
type: str
text: str
orig_text: Optional[str]
emoji: Optional[Emoji]
orig_text: Optional[str] = None
emoji: Optional[Emoji] = None
# RICH_TEXT_NODE_TYPE_TEXT 文本
# RICH_TEXT_NODE_TYPE_AT At
# RICH_TEXT_NODE_TYPE_VOTE 投票
Expand All @@ -32,6 +29,6 @@ class Topic(BaseModel):


class Text(BaseModel):
text: Optional[str]
topic: Optional[Topic]
rich_text_nodes: Optional[List[RichTextDetail]]
text: Optional[str] = None
topic: Optional[Topic] = None
rich_text_nodes: Optional[List[RichTextDetail]] = None
Loading

0 comments on commit 99a37d6

Please sign in to comment.