six_001
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
# from django.core.files.storage import default_storage
|
||||
# from django.core.files.uploadedfile import InMemoryUploadedFile
|
||||
# from django.core.handlers.wsgi import WSGIRequest
|
||||
# from django.forms import model_to_dict
|
||||
# from rest_framework import status
|
||||
# from rest_framework.decorators import action
|
||||
# from rest_framework.request import Request
|
||||
# from rest_framework.response import Response
|
||||
# from rest_framework.routers import SimpleRouter, DefaultRouter
|
||||
# from rest_framework.viewsets import ViewSet
|
||||
#
|
||||
# from sixGuoDjango import ResData, BaseResponse
|
||||
# from wechat_数据库.用户数据库.小程序登陆用户 import weiuser用户角色表choicesStatus
|
||||
#
|
||||
#
|
||||
# class 用户角色管理接口ViewSets(ViewSet):
|
||||
# @action(detail=False, methods=["get", "post", "put", "delete"], url_path="add_role")
|
||||
# def 添加用户角色接口(self, request: Request):
|
||||
# """ angular_permissions。"""
|
||||
# try:
|
||||
# pass
|
||||
# self_mini_openid = request.data.get("self_mini_openid", None)
|
||||
# self_mini_unionid = request.data.get("self_mini_unionid", None)
|
||||
# weiuser用户角色表.objects.get_or_create(user用户的unionid=self_mini_unionid, user用户角色名称=weiuser用户角色表choicesStatus.推广员.value, )
|
||||
# httpResData = BaseResponse(resData=ResData(listData=[""], dictData={"demo": "添加成功了"}), ).model_dump()
|
||||
# return Response(data=httpResData, status=status.HTTP_200_OK)
|
||||
# except Exception as e:
|
||||
# pass
|
||||
# httpResData = BaseResponse(resData=ResData(listData=[""], dictData={"demo": "xiaozizi"}), ).model_dump()
|
||||
# return Response(data=httpResData, status=status.HTTP_200_OK)
|
||||
#
|
||||
# @action(detail=False, methods=["get", "post", "put", "delete"], url_path="delete_role")
|
||||
# def 删除用户角色接口(self, request: Request):
|
||||
# """"""
|
||||
# self_mini_openid = request.data.get("self_mini_openid", None)
|
||||
# self_mini_unionid = request.data.get("self_mini_unionid", None)
|
||||
# print("🍎 🍏🍎 🍏🍎 🍏🍎 🍏🍎 🍏🍎 🍏🍎 🍏🍎 🍏🍎 🍏🍎 🍏🍎 🍏", self_mini_unionid)
|
||||
# httpResData = BaseResponse(resData=ResData(listData=[""], dictData={"demo": "xiaozizi"}), ).model_dump()
|
||||
# return Response(data=httpResData, status=status.HTTP_200_OK)
|
||||
#
|
||||
# @action(detail=False, methods=["get", "post", "put", "delete"], url_path="query_role")
|
||||
# def 查询用户角色(self, request: Request):
|
||||
# """"""
|
||||
# self_mini_openid = request.data.get("self_mini_openid", None)
|
||||
# self_mini_unionid = request.data.get("self_mini_unionid", None)
|
||||
#
|
||||
# print("🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 查询进来了")
|
||||
# 用户角色状态 = weiuser用户角色表.objects.filter(user用户的unionid=self_mini_unionid, user用户角色名称=weiuser用户角色表choicesStatus.推广员.value).first()
|
||||
# print(用户角色状态)
|
||||
# if 用户角色状态 is None:
|
||||
# # 这里表示用户角色不存在
|
||||
# httpResData = BaseResponse(resData=ResData(listData=[""], dictData={'idKey': '', 'user用户角色名称': '不是推广员', 'wai键用户表': ''}), ).model_dump()
|
||||
# return Response(data=httpResData, status=status.HTTP_200_OK)
|
||||
# if 用户角色状态 is not None:
|
||||
# data = model_to_dict(instance=用户角色状态, fields=None)
|
||||
# httpResData = BaseResponse(resData=ResData(listData=[""], dictData=data), ).model_dump()
|
||||
# return Response(data=httpResData, status=status.HTTP_200_OK)
|
||||
# httpResData = BaseResponse(resData=ResData(listData=[""], dictData={"demo": "xiaozizi"}), ).model_dump()
|
||||
# return Response(data=httpResData, status=status.HTTP_200_OK)
|
||||
#
|
||||
#
|
||||
# 用户角色管理接口ViewSetsDemoRouter = DefaultRouter()
|
||||
# 用户角色管理接口ViewSetsDemoRouter.register(prefix="", viewset=用户角色管理接口ViewSets, basename="")
|
||||
Reference in New Issue
Block a user