From 44063ab38f4b7a17f5a45d6d7a921bcce1c0abe7 Mon Sep 17 00:00:00 2001 From: MarkusJoe Date: Sun, 11 Sep 2022 11:40:59 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/utils/response.py | 40 ---------------------------------------- 2 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 src/utils/response.py diff --git a/README.md b/README.md index b0ec233..40ca6d5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # 预览 -![preview](https://counter-main.run.goorm.io/test) +preview # 新特性 diff --git a/src/utils/response.py b/src/utils/response.py deleted file mode 100644 index 1d9c1df..0000000 --- a/src/utils/response.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 -# -- coding:utf-8 -- -# @Author: markushammered@gmail.com -# @Development Tool: PyCharm -# @Create Time: 2022/8/30 -# @File Name: response.py - - -from src.db import Database - - -async def resp(_id: str, length: int = 7, theme: str = 'lewd') -> dict: - """ - return a response - :param _id: - :param length: - :param theme: - :return: - """ - times = Database().query(_id)[1] - str_number = str(times) # 将整形转换为字符串 - len_number = len(str_number) # 再获取字符串长度 - g_length = length * '0' # 根据输入的位数来自动生成0的数量 - show_number = str(g_length[:-len_number] + str_number) - context = [] - w_h = Database().query_image(theme + '/0')[0] - count = 0 # 计数器, 每次遍历一次则加一, 让图片x轴相乘 - for i in show_number: - data = Database().query_image(theme + '/' + i)[0] - context.append({'position': data[-2] * count, - 'width': data[-2], - 'height': data[-1], - 'base64': data[1]}) - count += 1 - headers = {'cache-control': 'max-age=0, no-cache, no-store, must-revalidate'} - - return {'context': context, - 'g_width': length * w_h[-2], - 'g_height': w_h[-1], - 'headers': headers}