This commit is contained in:
doudou201703
2026-08-21 23:48:29 +08:00
parent 0e2fe60253
commit dd4383130d
20 changed files with 179 additions and 241 deletions
+3 -3
View File
@@ -16,7 +16,6 @@ from rest_framework.viewsets import ViewSet
from django_jwt_token.jwt认证接口 import Jwt身份认证
from sixGuoDjango import BaseResponse, ResData, redis_5
from wechat_token.token工具包 import sixToken
default_channel_layer = cast(BaseChannelLayer, get_channel_layer(alias="default"))
@@ -37,7 +36,7 @@ def sync_lock(lock):
class DemoXiaoViewSets(ViewSet):
lock = threading.Lock() # 所有请求 共享这一个 lock对象
lock_sync_lock = threading.Lock() # 所有请求 共享这一个 lock对象
@action(detail=False, methods=["get", "post", "put", "delete"], url_path="zizi")
def 只用于初始化项目测试接口(self, request: Request):
@@ -103,7 +102,8 @@ class DemoXiaoViewSets(ViewSet):
@action(detail=False, methods=["get", "post", "put", "delete"], url_path="中文", )
def 中文(self, request: Request):
xiaozizi = request.data.get("xiaozizi", None)
return Response(data={"msg": xiaozizi})
print(xiaozizi)
return Response(data={"data_uri": "0909090"}, status=status.HTTP_200_OK)
DemoXiaoViewSetsDemoRouter = DefaultRouter()
+2
View File
@@ -45,12 +45,14 @@ class 小程序发优惠券到钱包接口ViewSets(ViewSet):
# 查询数据库,看看用户当前有没有券已发了但是还没有领取的状态
# stock发券数据 = stock发送代金券功能(stock_id_代金券批次号="22512292").send发券并返回前端需要的数据()
stock发券数据 = stock发送代金券功能(stock_id_代金券批次号="22625737", stock券的状态="待领券").send发券并返回前端需要的数据(self_mini_openid=self_mini_openid, self_mini_unionid=self_mini_unionid)
print(stock发券数据)
# 4. 生成签名
# return Response(data=stock发券数据)
return Response(data={"stock券状态": "待领券", "stock领券数据": stock发券数据})
else:
pass
print("查询是这里生效了啦")
print({"stock券状态": stock查询数据.stock_use_券状态, "stock领券数据": stock查询数据.stock_未领取券的数据})
return Response(data={"stock券状态": stock查询数据.stock_use_券状态, "stock领券数据": stock查询数据.stock_未领取券的数据})
@action(detail=False, methods=["get", "post", "put", "delete"], url_path="领券后更新当前券的状态")