整理代码

This commit is contained in:
2019-02-04 16:16:41 +08:00
parent 0219d5d1aa
commit 362f5c51d3
11 changed files with 202 additions and 20 deletions

19
Struct/LuckyUser.py Normal file
View File

@ -0,0 +1,19 @@
from .User import User
class LuckyUser:
user = None
count = 0
def __init__(self, json=None):
if json:
self.parse(json)
def parse(self, json):
self.user = User()
self.user.ID = json['user_id']
self.user.name = json['user_name']
self.count = int(json["grant_count"])
def __str__(self):
return "用户 {} 获得了 {}".format(self.user,self.count)