28 lines
665 B
Python
28 lines
665 B
Python
|
|
# 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
|