2025-04-14 12:11:23 +00:00
|
|
|
|
# coding=utf-8
|
|
|
|
|
|
"""
|
|
|
|
|
|
@project: MaxKB
|
|
|
|
|
|
@Author:虎虎
|
|
|
|
|
|
@file: user.py
|
|
|
|
|
|
@date:2025/4/14 19:23
|
|
|
|
|
|
@desc:
|
|
|
|
|
|
"""
|
2025-04-17 02:35:02 +00:00
|
|
|
|
from drf_spectacular.types import OpenApiTypes
|
|
|
|
|
|
from drf_spectacular.utils import OpenApiParameter
|
|
|
|
|
|
|
2025-04-14 12:11:23 +00:00
|
|
|
|
from common.mixins.api_mixin import APIMixin
|
|
|
|
|
|
from common.result import ResultSerializer
|
2025-04-27 08:26:40 +00:00
|
|
|
|
from users.serializers.user import UserProfileResponse, CreateUserSerializer
|
2025-04-14 12:11:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ApiUserProfileResponse(ResultSerializer):
|
|
|
|
|
|
def get_data(self):
|
|
|
|
|
|
return UserProfileResponse()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UserProfileAPI(APIMixin):
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
def get_response():
|
|
|
|
|
|
return ApiUserProfileResponse
|
2025-04-17 02:35:02 +00:00
|
|
|
|
|
2025-04-27 08:26:40 +00:00
|
|
|
|
@staticmethod
|
|
|
|
|
|
def get_request():
|
|
|
|
|
|
return CreateUserSerializer
|
|
|
|
|
|
|
2025-04-17 02:35:02 +00:00
|
|
|
|
|
|
|
|
|
|
class TestWorkspacePermissionUserApi(APIMixin):
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
def get_parameters():
|
|
|
|
|
|
return [OpenApiParameter(
|
|
|
|
|
|
# 参数的名称是done
|
|
|
|
|
|
name="workspace_id",
|
|
|
|
|
|
# 对参数的备注
|
|
|
|
|
|
description="工作空间id",
|
|
|
|
|
|
# 指定参数的类型
|
|
|
|
|
|
type=OpenApiTypes.STR,
|
|
|
|
|
|
location=OpenApiParameter.PATH,
|
|
|
|
|
|
# 指定必须给
|
|
|
|
|
|
required=True,
|
|
|
|
|
|
)]
|