|
@@ -35,6 +35,7 @@ router = APIRouter()
|
|
|
@router.get('/list')
|
|
|
async def get_publish_list(
|
|
|
search_keyword: str = Query('', description='信息内容'),
|
|
|
+ info_type: str = Query('', description='类型'),
|
|
|
page: int = Query(1, gt=0, description='页码'),
|
|
|
begin_time_s: str = Query(None, description='开始时间'),
|
|
|
end_time_s: str = Query(None, description='结束时间'),
|
|
@@ -48,6 +49,8 @@ async def get_publish_list(
|
|
|
where = and_(InfoPublishBase.del_flag == '0', InfoPublishBase.publish_status == 4)
|
|
|
if search_keyword != '':
|
|
|
where = and_(where, InfoPublishBase.content.like('%{}%'.format(search_keyword)))
|
|
|
+ if info_type != '':
|
|
|
+ where = and_(where, InfoPublishBase.info_type == info_type)
|
|
|
if begin_time_s != None:
|
|
|
begin_time = datetime.strptime(begin_time_s, "%Y-%m-%d")
|
|
|
where = and_(where, InfoPublishBase.publish_time >= begin_time)
|