20 lines
528 B
Python
20 lines
528 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
from web.dto.api_result import ApiResult
|
|
from web.dto.service_result import ServiceResult
|
|
|
|
|
|
class DtoUtil:
|
|
"""
|
|
dto的工具类
|
|
"""
|
|
|
|
@staticmethod
|
|
def service_result_to_api_result(service_result: ServiceResult) -> ApiResult:
|
|
"""
|
|
将ServiceResult对象转换为ApiResult对象
|
|
"""
|
|
|
|
return ApiResult.instance(service_result.success, service_result.code, service_result.data,
|
|
service_result.message)
|