-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,560 additions
and
134 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
server/src/main/java/com/jixialunbi/repository/TagRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.jixialunbi.repository; | ||
|
||
import com.jixialunbi.model.Category; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
|
||
public interface CategoryRepository extends JpaRepository<Category, Long> { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
web/components/post/TopicItem/components/CImage/index.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.wrap { | ||
:global { | ||
.ant-image-mask-info { | ||
display: none; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from "react"; | ||
import { Image } from 'antd'; | ||
import style from './index.module.scss'; | ||
|
||
export default function CImage(props) { | ||
const { src } = props; | ||
return <Image rootClassName={style.wrap} src={src} alt="" onLoad={(res: any) => { | ||
const oImg = new window.Image(); | ||
oImg.src = res.target.src; | ||
if (oImg.height / oImg.width >= 1.2) { | ||
res.currentTarget.style.height = 'auto' | ||
} | ||
}} /> | ||
} |
119 changes: 119 additions & 0 deletions
119
web/components/post/TopicItem/components/EllipsisDropdown/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import React from 'react'; | ||
import { DeleteOutlined, EllipsisOutlined, EyeFilled, PushpinOutlined } from '@ant-design/icons'; | ||
import { Button, Dropdown, Menu, message, Space } from 'antd'; | ||
import { useSWRMutation } from '@/hooks'; | ||
import { useAppStore } from '@/store'; | ||
|
||
interface Props { | ||
authorId: number; | ||
pinned: boolean; | ||
postId: number; | ||
id: number; | ||
} | ||
|
||
export default function EllipsisDropdown(props: Props) { | ||
// const user = useAppSelector((state) => state.app.user); | ||
// const dispatch = useAppDispatch(); | ||
const user = useAppStore((state) => state.user); | ||
const { trigger: deletePost } = useSWRMutation({ url: '/api/v1/delete-post' }); | ||
// const [deletePost] = useDeletePostMutation(); | ||
// const [pinPost] = usePinPostMutation(); | ||
return ( | ||
<React.Fragment> | ||
<Dropdown | ||
menu={{ | ||
onClick: ({ key }) => { | ||
// if (key === '举报' && !user) { | ||
// return dispatch(showLoginModal(true)); | ||
// } | ||
// if (key == '编辑') { | ||
// return dispatch( | ||
// setWriteModalState({ | ||
// visible: true, | ||
// postId: props.postId, | ||
// type: 'write', | ||
// }) | ||
// ); | ||
// } | ||
// if (key == '时间线') { | ||
// return setTimeLine({ | ||
// visible: true, | ||
// id: props.id, | ||
// }); | ||
// } | ||
if (key === '删除') { | ||
deletePost({ id: props.postId } as any).then(() => { | ||
message.success('删除成功!'); | ||
}); | ||
} | ||
// if (key === '置顶') { | ||
// pinPost({ id: props.postId, pinned: !props.pinned }) | ||
// .unwrap() | ||
// .then(() => { | ||
// message.success(props.pinned ? '已取消置顶!' : '置顶成功!'); | ||
// }); | ||
// } | ||
}, | ||
items: [ | ||
...(user?.id !== props.authorId | ||
? [ | ||
{ | ||
label: ( | ||
<Space> | ||
<EyeFilled></EyeFilled>举报 | ||
</Space> | ||
), | ||
key: '举报', | ||
}, | ||
] | ||
: []), | ||
...(user && user.role === 'SuperAdmin' | ||
? [ | ||
{ | ||
label: ( | ||
<Space> | ||
<PushpinOutlined /> | ||
{props.pinned ? '取消置顶' : '置顶'} | ||
</Space> | ||
), | ||
key: '置顶', | ||
}, | ||
] | ||
: []), | ||
...(user?.id === props.authorId | ||
? [ | ||
// { | ||
// label: ( | ||
// <Space> | ||
// <EditOutlined></EditOutlined>编辑 | ||
// </Space> | ||
// ), | ||
// key: '编辑', | ||
// }, | ||
// { | ||
// label: ( | ||
// <Space> | ||
// <PlusCircleOutlined></PlusCircleOutlined>时间线 | ||
// </Space> | ||
// ), | ||
// key: '时间线', | ||
// }, | ||
{ | ||
label: ( | ||
<Space style={{ color: '#ff7875' }}> | ||
<DeleteOutlined></DeleteOutlined>删除 | ||
</Space> | ||
), | ||
key: '删除', | ||
}, | ||
] | ||
: []), | ||
], | ||
}} | ||
trigger={['click']} | ||
> | ||
<Button icon={<EllipsisOutlined />} type="text" size="small"></Button> | ||
</Dropdown> | ||
</React.Fragment> | ||
); | ||
} |
41 changes: 41 additions & 0 deletions
41
web/components/post/TopicItem/components/TimeLine/index.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.timeline { | ||
margin-bottom: -20px; | ||
.timelineTitle { | ||
display: inline-flex; | ||
align-items: center; | ||
position: relative; | ||
background: #df542f; | ||
color: #fff; | ||
padding-right: 10px; | ||
border-top-right-radius: 10px; | ||
border-bottom-right-radius: 10px; | ||
margin-left: -10px; | ||
margin-bottom: 13px; | ||
svg { | ||
fill: #fff; | ||
} | ||
} | ||
.timelineTime { | ||
color: #97999f; | ||
} | ||
.timelineItemContent { | ||
background: #f6f7f9; | ||
padding: 1px 10px; | ||
border-radius: 8px; | ||
} | ||
.lastEditTime { | ||
color: rgba(0, 0, 0, 0.45); | ||
font-size: 12px; | ||
padding: 8px 5px; | ||
margin-bottom: 0; | ||
display: flex; | ||
justify-content: flex-end; | ||
flex: 1 0 auto; | ||
} | ||
} | ||
|
||
.delete { | ||
svg { | ||
fill: #ff4d4f; | ||
} | ||
} |
Oops, something went wrong.