28 lines
665 B
Python
Raw Permalink Normal View History

2025-12-04 10:04:21 +08:00
# 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