-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
29 changed files
with
2,670 additions
and
1,859 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[metadata] | ||
name = retk | ||
version = 0.2.7 | ||
version = 0.2.8 | ||
author = MorvanZhou | ||
author_email = [email protected] | ||
description = keep and reuse your thoughts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from retk import core | ||
from retk.controllers import schemas | ||
from retk.controllers.utils import maybe_raise_json_exception | ||
from retk.models.tps import AuthedUser | ||
from retk.utils import datetime2str | ||
|
||
|
||
async def get_system_notice( | ||
au: AuthedUser, | ||
notice_id: str, | ||
) -> schemas.notice.SystemNoticeResponse: | ||
code = await core.notice.mark_system_notice_read( | ||
uid=au.u.id, | ||
notice_id=notice_id, | ||
) | ||
maybe_raise_json_exception(au=au, code=code) | ||
|
||
n, code = await core.notice.get_system_notice( | ||
uid=au.u.id, | ||
notice_id=notice_id, | ||
) | ||
maybe_raise_json_exception(au=au, code=code) | ||
|
||
return schemas.notice.SystemNoticeResponse( | ||
requestId=au.request_id, | ||
notice=schemas.notice.SystemNoticeResponse.Notice( | ||
id=str(n["_id"]), | ||
title=n["title"], | ||
html=n["html"], | ||
publishAt=datetime2str(n["publishAt"]), | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
app_system, | ||
manager, | ||
statistic, | ||
notice, | ||
) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from pydantic import BaseModel | ||
|
||
|
||
class SystemNoticeResponse(BaseModel): | ||
class Notice(BaseModel): | ||
id: str | ||
title: str | ||
html: str | ||
publishAt: str | ||
|
||
requestId: str | ||
notice: Notice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.