forked from Dniel97/artemis
aimedb: add last login time update to register endpoints
This commit is contained in:
parent
4149944d56
commit
89c2b324dc
@ -192,7 +192,8 @@ class AimedbServlette():
|
|||||||
f"access_code {req.access_code} -> user_id {ret.user_id}"
|
f"access_code {req.access_code} -> user_id {ret.user_id}"
|
||||||
)
|
)
|
||||||
|
|
||||||
await self.data.card.update_card_last_login(req.access_code)
|
if user_id and user_id > 0:
|
||||||
|
await self.data.card.update_card_last_login(req.access_code)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
async def handle_lookup_ex(self, data: bytes, resp_code: int) -> ADBBaseResponse:
|
async def handle_lookup_ex(self, data: bytes, resp_code: int) -> ADBBaseResponse:
|
||||||
@ -222,7 +223,8 @@ class AimedbServlette():
|
|||||||
self.logger.debug(f"Generated auth token {auth_key}")
|
self.logger.debug(f"Generated auth token {auth_key}")
|
||||||
ret.auth_key = auth_key_full
|
ret.auth_key = auth_key_full
|
||||||
|
|
||||||
await self.data.card.update_card_last_login(req.access_code)
|
if user_id and user_id > 0:
|
||||||
|
await self.data.card.update_card_last_login(req.access_code)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
async def handle_felica_lookup(self, data: bytes, resp_code: int) -> bytes:
|
async def handle_felica_lookup(self, data: bytes, resp_code: int) -> bytes:
|
||||||
@ -271,6 +273,8 @@ class AimedbServlette():
|
|||||||
f"Registration blocked!: access code {ac} (IDm: {req.idm} PMm: {req.pmm})"
|
f"Registration blocked!: access code {ac} (IDm: {req.idm} PMm: {req.pmm})"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if user_id > 0:
|
||||||
|
await self.data.card.update_card_last_login(ac)
|
||||||
return ADBFelicaLookupResponse.from_req(req.head, ac)
|
return ADBFelicaLookupResponse.from_req(req.head, ac)
|
||||||
|
|
||||||
async def handle_felica_lookup_ex(self, data: bytes, resp_code: int) -> bytes:
|
async def handle_felica_lookup_ex(self, data: bytes, resp_code: int) -> bytes:
|
||||||
@ -295,8 +299,8 @@ class AimedbServlette():
|
|||||||
self.logger.debug(f"Generated auth token {auth_key}")
|
self.logger.debug(f"Generated auth token {auth_key}")
|
||||||
resp.auth_key = auth_key_full
|
resp.auth_key = auth_key_full
|
||||||
|
|
||||||
|
if user_id and user_id > 0:
|
||||||
await self.data.card.update_card_last_login(access_code)
|
await self.data.card.update_card_last_login(access_code)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
async def handle_campaign_clear(self, data: bytes, resp_code: int) -> ADBBaseResponse:
|
async def handle_campaign_clear(self, data: bytes, resp_code: int) -> ADBBaseResponse:
|
||||||
@ -338,6 +342,9 @@ class AimedbServlette():
|
|||||||
if resp.user_id <= 0:
|
if resp.user_id <= 0:
|
||||||
resp.head.status = ADBStatus.BAN_SYS # Closest we can get to a "You cannot register"
|
resp.head.status = ADBStatus.BAN_SYS # Closest we can get to a "You cannot register"
|
||||||
|
|
||||||
|
else:
|
||||||
|
await self.data.card.update_card_last_login(req.access_code)
|
||||||
|
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
# TODO: Save these in some capacity, as deemed relevant
|
# TODO: Save these in some capacity, as deemed relevant
|
||||||
|
Loading…
Reference in New Issue
Block a user