Skip to content

Commit

Permalink
change params order
Browse files Browse the repository at this point in the history
  • Loading branch information
freeziyou committed Feb 27, 2024
1 parent 611cf4c commit e84ea03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/routes/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def set_account():
return jsonify({"code": 0, "msg": "success"})


@bp.route("/<team_id>/<message_id>/<repo_id>/image/<img_key>", methods=["GET"])
@bp.route("/<team_id>/<repo_id>/<message_id>/image/<img_key>", methods=["GET"])
def get_image(team_id, message_id, repo_id, img_key):
"""
1. 用 img_key 请求飞书接口下载 image
Expand Down
4 changes: 2 additions & 2 deletions server/tasks/lark/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def process_desc(app_id, message_id, repo_id, desc, data, team, *args, **kwargs)
def replace_images_keys_with_url(text, team_id, message_id, repo_id):
"""
replace image_key with image URL.
![](image_key) -> ![](gitmaya.com/api/<team_id>/<message_id>/<repo_id>/image/<image_key>)
![](image_key) -> ![](gitmaya.com/api/<team_id>/<repo_id>/<message_id>/image/<image_key>)
Args:
text (str): original text
Expand All @@ -359,7 +359,7 @@ def replace_images_keys_with_url(text, team_id, message_id, repo_id):
host = os.environ.get("DOMAIN")
replaced_text = re.sub(
r"!\[.*?\]\((.*?)\)",
lambda match: f"![]({host}/api/{team_id}/{message_id}/{repo_id}/image/{match.group(1)})",
lambda match: f"![]({host}/api/{team_id}/{repo_id}/{message_id}/image/{match.group(1)})",
text,
)

Expand Down

0 comments on commit e84ea03

Please sign in to comment.