重建仓库,重新提交。
This commit is contained in:
21
Entity/AnchorModel.py
Normal file
21
Entity/AnchorModel.py
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
# 主播模型
|
||||
class AnchorModel:
|
||||
def __init__(self, anchorId= "", country= ""):
|
||||
# 主播ID
|
||||
self.anchorId = anchorId
|
||||
# 主播国家
|
||||
self.country = country
|
||||
|
||||
# 字典转模型
|
||||
@classmethod
|
||||
def dictToModel(cls, d):
|
||||
model = AnchorModel()
|
||||
model.anchorId = d.get('anchorId', "")
|
||||
model.country = d.get('country', "")
|
||||
return model
|
||||
|
||||
# 模型转字典
|
||||
@classmethod
|
||||
def modelToDict(cls, model):
|
||||
return {"anchorId": model.anchorId, "country": model.country}
|
||||
Reference in New Issue
Block a user