2025-12-04 10:04:21 +08:00

28 lines
665 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# app/models/domain/articles.py
from typing import List, Optional
from app.models.common import DateTimeModelMixin, IDModelMixin
from app.models.domain.profiles import Profile
from app.models.domain.rwmodel import RWModel
class Article(IDModelMixin, DateTimeModelMixin, RWModel):
slug: str
title: str
description: str
body: str
# 封面(可选,不影响老数据)
cover: Optional[str] = None
# 置顶 / 推荐 / 权重camelCase 输出)
is_top: bool = False
is_featured: bool = False
sort_weight: int = 0
tags: List[str]
author: Profile
favorited: bool
favorites_count: int
views: int = 0