feat:完成底部
This commit is contained in:
@@ -13,3 +13,10 @@ export function add(data){
|
|||||||
data:data
|
data:data
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export function del(ids){
|
||||||
|
return myaxios({
|
||||||
|
url: `/comment/${ids}`,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
};
|
||||||
@@ -1,25 +1,36 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="body-div">
|
<div class="botton-div">
|
||||||
<a>站长:橙子</a>
|
<a><el-icon><UserFilled /></el-icon>站长:橙子</a>
|
||||||
<a>YiFramework意框架</a>
|
<a><el-icon><Search /></el-icon>YiFramework意框架</a>
|
||||||
<a>关于本站    建议反馈</a>
|
<a><el-icon><View /></el-icon>关于本站</a>
|
||||||
<a>2023 <span style="color: #40a9ff ;">意社区</span> | 赣ICP备xxxxxx号-4</a>
|
<a><el-icon><Message /></el-icon>建议反馈</a>
|
||||||
|
<p></p>
|
||||||
|
<a><el-icon><Position /></el-icon>2023 <span style="color: #40a9ff ;">意社区</span> | 赣ICP备xxxxxx号-4</a>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.el-icon
|
||||||
|
{margin: 0 0.2rem;}
|
||||||
a{
|
a{
|
||||||
display: block;
|
margin-right: 2rem;
|
||||||
|
line-height: 1.8rem;
|
||||||
}
|
}
|
||||||
a:hover {
|
a:hover {
|
||||||
color: #40a9ff;
|
color: #40a9ff;
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
}
|
}
|
||||||
.body-div
|
.botton-div
|
||||||
{
|
{
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: rgba(0,0,0,.45);
|
color: rgba(0,0,0,.45);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
height: auto;
|
||||||
|
width: auto;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 1rem auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -32,11 +32,13 @@
|
|||||||
<span class="pointer"><el-icon>
|
<span class="pointer"><el-icon>
|
||||||
<Pointer />
|
<Pointer />
|
||||||
</el-icon> 4</span>
|
</el-icon> 4</span>
|
||||||
<el-button @click="replay(item.createUser.nick, item.id, item.id)" size="large" text>回复</el-button>
|
<el-button type="primary" @click="replay(item.createUser.nick, item.id, item.id)" size="large" text>回复</el-button>
|
||||||
|
<el-button type="danger" @click="delComment(item.id)" size="large" text>删除</el-button>
|
||||||
<div v-show="replayId == item.id" class="input-reply">
|
<div v-show="replayId == item.id" class="input-reply">
|
||||||
<el-input v-model="form.content" :placeholder="placeholder" :rows="3" type="textarea"></el-input>
|
<el-input v-model="form.content" :placeholder="placeholder" :rows="3" type="textarea"></el-input>
|
||||||
<div class="btn-reply">
|
<div class="btn-reply">
|
||||||
<el-button @click="addComment" type="primary">回复</el-button>
|
<el-button @click="addComment" type="primary">回复</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -46,7 +48,7 @@
|
|||||||
|
|
||||||
<div style="display: flex ;">
|
<div style="display: flex ;">
|
||||||
<AvatarInfo :userInfo="children.createUser" />
|
<AvatarInfo :userInfo="children.createUser" />
|
||||||
<span style="align-self: center;"> 回复@{{ children.commentedUser.nick }}</span>
|
<span style="align-self: center;color:#606266;"> 回复@{{ children.commentedUser.nick }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
{{ children.content }}
|
{{ children.content }}
|
||||||
@@ -55,8 +57,8 @@
|
|||||||
<span class="pointer"> <el-icon>
|
<span class="pointer"> <el-icon>
|
||||||
<Pointer />
|
<Pointer />
|
||||||
</el-icon>0</span>
|
</el-icon>0</span>
|
||||||
<el-button @click="replay(children.createUser.nick, children.id, item.id)" size="large" text>回复</el-button>
|
<el-button type="primary" @click="replay(children.createUser.nick, children.id, item.id)" size="large" text>回复</el-button>
|
||||||
|
<el-button type="danger" @click="delComment(children.id)" size="large" text>删除</el-button>
|
||||||
<div v-show="replayId == children.id" class="input-reply">
|
<div v-show="replayId == children.id" class="input-reply">
|
||||||
<el-input v-model="form.content" :placeholder="placeholder" :rows="3" type="textarea"></el-input>
|
<el-input v-model="form.content" :placeholder="placeholder" :rows="3" type="textarea"></el-input>
|
||||||
<div class="btn-reply">
|
<div class="btn-reply">
|
||||||
@@ -74,7 +76,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { getListByDiscussId, add } from "@/apis/commentApi.js";
|
import { getListByDiscussId, add ,del} from "@/apis/commentApi.js";
|
||||||
import AvatarInfo from './AvatarInfo.vue';
|
import AvatarInfo from './AvatarInfo.vue';
|
||||||
//数据定义
|
//数据定义
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@@ -129,6 +131,23 @@ const addComment = async () => {
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
const delComment=async(ids)=>{
|
||||||
|
ElMessageBox.confirm(`确定是否删除编号[${ids}]的评论吗?`, "警告", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}).then(async () => {
|
||||||
|
|
||||||
|
await del(ids);
|
||||||
|
await loadComment();
|
||||||
|
ElMessage({
|
||||||
|
message: '评论已删除!',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
const replay = async (parentUserName, parentId, rootId) => {
|
const replay = async (parentUserName, parentId, rootId) => {
|
||||||
replayId.value = parentId;
|
replayId.value = parentId;
|
||||||
form.parentId = parentId;
|
form.parentId = parentId;
|
||||||
|
|||||||
@@ -19,8 +19,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<el-button icon="Pointer" text @click="agree">
|
<el-button text @click="agree" >
|
||||||
点赞:{{ agreeNum??0 }}</el-button>
|
<el-icon v-if="isAgree" color="#409EFF"><CircleCheckFilled /></el-icon>
|
||||||
|
<el-icon v-else color="#1E1E1E" ><Pointer /></el-icon> 点赞:{{ agreeNum??0 }}</el-button>
|
||||||
<el-button icon="Star" text>
|
<el-button icon="Star" text>
|
||||||
收藏</el-button>
|
收藏</el-button>
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ import { useRouter } from 'vue-router'
|
|||||||
import AvatarInfo from './AvatarInfo.vue';
|
import AvatarInfo from './AvatarInfo.vue';
|
||||||
import {operate} from '@/apis/agreeApi'
|
import {operate} from '@/apis/agreeApi'
|
||||||
|
|
||||||
const props = defineProps(['title','introduction','creationTime','id','user','badge',"color","seeNum","agreeNum"])
|
const props = defineProps(['title','introduction','creationTime','id','user','badge',"color","seeNum","agreeNum","isAgree"])
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const spacer = h(ElDivider, { direction: 'vertical' })
|
const spacer = h(ElDivider, { direction: 'vertical' })
|
||||||
@@ -47,13 +48,15 @@ const enterDiscuss = (id) => {
|
|||||||
router.push(`/article/${id}`)
|
router.push(`/article/${id}`)
|
||||||
}
|
}
|
||||||
const agreeNum=ref(0)
|
const agreeNum=ref(0)
|
||||||
|
const isAgree=ref(false)
|
||||||
//点赞操作
|
//点赞操作
|
||||||
const agree=async ()=>{
|
const agree=async ()=>{
|
||||||
const response= await operate(props.id)
|
const response= await operate(props.id)
|
||||||
const res=response.data;
|
const res=response.data;
|
||||||
//提示框,颜色区分
|
//提示框,颜色区分
|
||||||
if(res.isArgee)
|
if(res.isAgree)
|
||||||
{
|
{
|
||||||
|
isAgree.value=true;
|
||||||
agreeNum.value+=1;
|
agreeNum.value+=1;
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: res.message,
|
message: res.message,
|
||||||
@@ -62,6 +65,7 @@ const agree=async ()=>{
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
isAgree.value=false;
|
||||||
agreeNum.value-=1;
|
agreeNum.value-=1;
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: res.message,
|
message: res.message,
|
||||||
@@ -70,6 +74,7 @@ const agree=async ()=>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
|
isAgree.value=props.isAgree;
|
||||||
agreeNum.value=props.agreeNum;
|
agreeNum.value=props.agreeNum;
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -58,7 +58,9 @@
|
|||||||
<CommentInfo/>
|
<CommentInfo/>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<BottomInfo/>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
@@ -126,7 +128,7 @@ import AvatarInfo from "@/components/AvatarInfo.vue";
|
|||||||
import InfoCard from "@/components/InfoCard.vue";
|
import InfoCard from "@/components/InfoCard.vue";
|
||||||
import ArticleContentInfo from "@/components/ArticleContentInfo.vue";
|
import ArticleContentInfo from "@/components/ArticleContentInfo.vue";
|
||||||
import CommentInfo from "@/components/CommentInfo.vue";
|
import CommentInfo from "@/components/CommentInfo.vue";
|
||||||
|
import BottomInfo from '@/components/BottomInfo.vue'
|
||||||
import TreeArticleInfo from "@/components/TreeArticleInfo.vue";
|
import TreeArticleInfo from "@/components/TreeArticleInfo.vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
|
||||||
|
|||||||
@@ -58,14 +58,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="div-item" v-for="i in topDiscussList" >
|
<div class="div-item" v-for="i in topDiscussList" >
|
||||||
<DisscussCard :title="i.title" :introduction="i.introduction" :creationTime="i.creationTime" :agreeNum="i.agreeNum" :id="i.id" :user="i.user" :color="i.color" :seeNum="i.seeNum" badge="置顶"/>
|
<DisscussCard :title="i.title" :isAgree="i.isAgree" :introduction="i.introduction" :creationTime="i.creationTime" :agreeNum="i.agreeNum" :id="i.id" :user="i.user" :color="i.color" :seeNum="i.seeNum" badge="置顶"/>
|
||||||
</div>
|
</div>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
<el-divider v-show="topDiscussList.length>0" />
|
<el-divider v-show="topDiscussList.length>0" />
|
||||||
|
|
||||||
<div class="div-item" v-for="i in discussList" >
|
<div class="div-item" v-for="i in discussList" >
|
||||||
<DisscussCard :title="i.title" :introduction="i.introduction" :creationTime="i.creationTime" :agreeNum="i.agreeNum" :id="i.id" :color="i.color" :seeNum="i.seeNum" :user="i.user"/>
|
<DisscussCard :title="i.title" :isAgree="i.isAgree" :introduction="i.introduction" :creationTime="i.creationTime" :agreeNum="i.agreeNum" :id="i.id" :color="i.color" :seeNum="i.seeNum" :user="i.user"/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@@ -81,7 +81,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-empty v-if="discussList.length==0" description="空空如也" />
|
<el-empty v-if="discussList.length==0" description="空空如也" />
|
||||||
|
<BottomInfo/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
@@ -90,7 +95,7 @@ import DisscussCard from '@/components/DisscussCard.vue'
|
|||||||
import {getList,getTopList} from '@/apis/discussApi.js'
|
import {getList,getTopList} from '@/apis/discussApi.js'
|
||||||
import { onMounted, ref,reactive } from 'vue'
|
import { onMounted, ref,reactive } from 'vue'
|
||||||
import { useRoute,useRouter } from 'vue-router'
|
import { useRoute,useRouter } from 'vue-router'
|
||||||
|
import BottomInfo from '@/components/BottomInfo.vue'
|
||||||
//数据定义
|
//数据定义
|
||||||
const route=useRoute()
|
const route=useRoute()
|
||||||
const router=useRouter()
|
const router=useRouter()
|
||||||
|
|||||||
@@ -10,11 +10,11 @@
|
|||||||
|
|
||||||
<el-row class="left-div">
|
<el-row class="left-div">
|
||||||
<el-col :span="8" v-for="i in plateList" class="plate" :style="{ 'padding-left': i%3==1?0:0.2+'rem','padding-right': i%3==0?0:0.2+'rem'}" >
|
<el-col :span="8" v-for="i in plateList" class="plate" :style="{ 'padding-left': i%3==1?0:0.2+'rem','padding-right': i%3==0?0:0.2+'rem'}" >
|
||||||
<PlateCard :name="i.name" :introduction="i.introduction" :id="i.id"/>
|
<PlateCard :name="i.name" :introduction="i.introduction" :id="i.id" />
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24" v-for="i in discussList">
|
<el-col :span="24" v-for="i in discussList">
|
||||||
<DisscussCard :title="i.title" :introduction="i.introduction" :creationTime="i.creationTime" :agreeNum="i.agreeNum" :id="i.id" :user="i.user" :seeNum="i.seeNum"/>
|
<DisscussCard :title="i.title" :introduction="i.introduction" :creationTime="i.creationTime" :agreeNum="i.agreeNum" :id="i.id" :user="i.user" :seeNum="i.seeNum" :isAgree="i.isAgree"/>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
|
|||||||
@@ -94,6 +94,11 @@
|
|||||||
Discuss输入创建对象
|
Discuss输入创建对象
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:Yi.BBS.Application.Contracts.Forum.Dtos.Discuss.DiscussGetListOutputDto.IsAgree">
|
||||||
|
<summary>
|
||||||
|
是否已点赞
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:Yi.BBS.Application.Contracts.Forum.Dtos.MyTypeCreateInputVo">
|
<member name="T:Yi.BBS.Application.Contracts.Forum.Dtos.MyTypeCreateInputVo">
|
||||||
<summary>
|
<summary>
|
||||||
Label输入创建对象
|
Label输入创建对象
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Yi.BBS.Application.Contracts.Exhibition.Dtos.Argee
|
namespace Yi.BBS.Application.Contracts.Exhibition.Dtos.Argee
|
||||||
{
|
{
|
||||||
public class ArgeeDto
|
public class AgreeDto
|
||||||
{
|
{
|
||||||
public ArgeeDto(bool isArgee)
|
public AgreeDto(bool isAgree)
|
||||||
{
|
{
|
||||||
IsArgee = isArgee;
|
IsAgree = isAgree;
|
||||||
if (isArgee)
|
if (isAgree)
|
||||||
{
|
{
|
||||||
|
|
||||||
Message = "点赞成功,点赞+1";
|
Message = "点赞成功,点赞+1";
|
||||||
@@ -24,7 +24,7 @@ namespace Yi.BBS.Application.Contracts.Exhibition.Dtos.Argee
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsArgee { get; set; }
|
public bool IsAgree { get; set; }
|
||||||
public string Message { get; set; }
|
public string Message { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ namespace Yi.BBS.Application.Exhibition
|
|||||||
/// 点赞,返回true为点赞+1,返回false为点赞-1
|
/// 点赞,返回true为点赞+1,返回false为点赞-1
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<ArgeeDto> PostOperateAsync(long discussId)
|
public async Task<AgreeDto> PostOperateAsync(long discussId)
|
||||||
{
|
{
|
||||||
var entity = await _repository.GetFirstAsync(x => x.DiscussId == discussId && x.CreatorId == _currentUser.Id);
|
var entity = await _repository.GetFirstAsync(x => x.DiscussId == discussId && x.CreatorId == _currentUser.Id);
|
||||||
//判断是否已经点赞过
|
//判断是否已经点赞过
|
||||||
@@ -56,7 +56,7 @@ namespace Yi.BBS.Application.Exhibition
|
|||||||
await _discssRepository.UpdateAsync(discussEntity);
|
await _discssRepository.UpdateAsync(discussEntity);
|
||||||
uow.Commit();
|
uow.Commit();
|
||||||
}
|
}
|
||||||
return new ArgeeDto(true);
|
return new AgreeDto(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -75,7 +75,7 @@ namespace Yi.BBS.Application.Exhibition
|
|||||||
uow.Commit();
|
uow.Commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ArgeeDto(false);
|
return new AgreeDto(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -94,6 +94,11 @@
|
|||||||
Discuss输入创建对象
|
Discuss输入创建对象
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:Yi.BBS.Application.Contracts.Forum.Dtos.Discuss.DiscussGetListOutputDto.IsAgree">
|
||||||
|
<summary>
|
||||||
|
是否已点赞
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:Yi.BBS.Application.Contracts.Forum.Dtos.MyTypeCreateInputVo">
|
<member name="T:Yi.BBS.Application.Contracts.Forum.Dtos.MyTypeCreateInputVo">
|
||||||
<summary>
|
<summary>
|
||||||
Label输入创建对象
|
Label输入创建对象
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Contracts.Exhibition.Dtos.Argee
|
|
||||||
{
|
|
||||||
public class ArgeeDto
|
|
||||||
{
|
|
||||||
public ArgeeDto(bool isArgee)
|
|
||||||
{
|
|
||||||
IsArgee = isArgee;
|
|
||||||
if (isArgee)
|
|
||||||
{
|
|
||||||
|
|
||||||
Message = "点赞成功,点赞+1";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
Message = "取消点赞,点赞-1";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsArgee { get; set; }
|
|
||||||
public string Message { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -11,7 +11,10 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss
|
|||||||
{
|
{
|
||||||
public class DiscussGetListOutputDto : IEntityDto<long>
|
public class DiscussGetListOutputDto : IEntityDto<long>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <20>Ƿ<EFBFBD><C7B7>ѵ<EFBFBD><D1B5><EFBFBD>
|
||||||
|
/// </summary>
|
||||||
|
public bool IsAgree { get; set; }
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string Types { get; set; }
|
public string Types { get; set; }
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace Yi.BBS.Application.Exhibition
|
|||||||
/// 点赞,返回true为点赞+1,返回false为点赞-1
|
/// 点赞,返回true为点赞+1,返回false为点赞-1
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<ArgeeDto> PostOperateAsync(long discussId)
|
public async Task<AgreeDto> PostOperateAsync(long discussId)
|
||||||
{
|
{
|
||||||
var entity = await _repository.GetFirstAsync(x => x.DiscussId == discussId && x.CreatorId == _currentUser.Id);
|
var entity = await _repository.GetFirstAsync(x => x.DiscussId == discussId && x.CreatorId == _currentUser.Id);
|
||||||
//判断是否已经点赞过
|
//判断是否已经点赞过
|
||||||
@@ -56,7 +56,7 @@ namespace Yi.BBS.Application.Exhibition
|
|||||||
await _discssRepository.UpdateAsync(discussEntity);
|
await _discssRepository.UpdateAsync(discussEntity);
|
||||||
uow.Commit();
|
uow.Commit();
|
||||||
}
|
}
|
||||||
return new ArgeeDto(true);
|
return new AgreeDto(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -75,7 +75,7 @@ namespace Yi.BBS.Application.Exhibition
|
|||||||
uow.Commit();
|
uow.Commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ArgeeDto(false);
|
return new AgreeDto(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
|||||||
using Cike.EventBus.DistributedEvent;
|
using Cike.EventBus.DistributedEvent;
|
||||||
using Yi.BBS.Domain.Shared.Forum.Etos;
|
using Yi.BBS.Domain.Shared.Forum.Etos;
|
||||||
using Yi.BBS.Domain.Shared.Forum.EnumClasses;
|
using Yi.BBS.Domain.Shared.Forum.EnumClasses;
|
||||||
|
using Yi.Framework.Core.CurrentUsers;
|
||||||
|
using Yi.BBS.Domain.Exhibition.Entities;
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Forum
|
namespace Yi.BBS.Application.Forum
|
||||||
{
|
{
|
||||||
@@ -36,6 +38,8 @@ namespace Yi.BBS.Application.Forum
|
|||||||
[Autowired]
|
[Autowired]
|
||||||
private IDistributedEventBus _distributedEventBus { get; set; }
|
private IDistributedEventBus _distributedEventBus { get; set; }
|
||||||
|
|
||||||
|
[Autowired]
|
||||||
|
private ICurrentUser _currentUser { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单查
|
/// 单查
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -47,10 +51,13 @@ namespace Yi.BBS.Application.Forum
|
|||||||
var item = await _DbQueryable.LeftJoin<UserEntity>((discuss, user) => discuss.CreatorId == user.Id)
|
var item = await _DbQueryable.LeftJoin<UserEntity>((discuss, user) => discuss.CreatorId == user.Id)
|
||||||
.Select((discuss, user) => new DiscussGetOutputDto
|
.Select((discuss, user) => new DiscussGetOutputDto
|
||||||
{
|
{
|
||||||
User = new UserGetListOutputDto() { UserName = user.UserName, Nick = user.Nick,Icon=user.Icon }
|
User = new UserGetListOutputDto() { UserName = user.UserName, Nick = user.Nick, Icon = user.Icon }
|
||||||
}, true).SingleAsync(discuss => discuss.Id==id);
|
}, true).SingleAsync(discuss => discuss.Id == id);
|
||||||
|
if (item is not null)
|
||||||
|
{
|
||||||
|
_distributedEventBus.PublishAsync(new SeeDiscussEventArgs { DiscussId = item.Id, OldSeeNum = item.SeeNum });
|
||||||
|
}
|
||||||
|
|
||||||
_distributedEventBus.PublishAsync(new SeeDiscussEventArgs { DiscussId= item.Id, OldSeeNum= item .SeeNum});
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,21 +68,24 @@ namespace Yi.BBS.Application.Forum
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|
||||||
public override async Task<PagedResultDto<DiscussGetListOutputDto>> GetListAsync( [FromQuery] DiscussGetListInputVo input)
|
public override async Task<PagedResultDto<DiscussGetListOutputDto>> GetListAsync([FromQuery] DiscussGetListInputVo input)
|
||||||
{
|
{
|
||||||
//需要关联创建者用户
|
//需要关联创建者用户
|
||||||
RefAsync<int> total = 0;
|
RefAsync<int> total = 0;
|
||||||
var items = await _DbQueryable
|
var items = await _DbQueryable
|
||||||
.WhereIF(!string.IsNullOrEmpty(input.Title), x => x.Title.Contains(input.Title))
|
.WhereIF(!string.IsNullOrEmpty(input.Title), x => x.Title.Contains(input.Title))
|
||||||
.WhereIF(input.PlateId is not null, x => x.PlateId == input.PlateId)
|
.WhereIF(input.PlateId is not null, x => x.PlateId == input.PlateId)
|
||||||
.Where(x=>x.IsTop==input.IsTop)
|
.Where(x => x.IsTop == input.IsTop)
|
||||||
.OrderByIF(input.Type==QueryDiscussTypeEnum.New, x =>x.CreationTime,OrderByType.Desc )
|
.OrderByIF(input.Type == QueryDiscussTypeEnum.New, x => x.CreationTime, OrderByType.Desc)
|
||||||
.OrderByIF(input.Type == QueryDiscussTypeEnum.Host, x => x.SeeNum, OrderByType.Desc)
|
.OrderByIF(input.Type == QueryDiscussTypeEnum.Host, x => x.SeeNum, OrderByType.Desc)
|
||||||
.OrderByIF(input.Type == QueryDiscussTypeEnum.Suggest, x => x.AgreeNum, OrderByType.Desc)
|
.OrderByIF(input.Type == QueryDiscussTypeEnum.Suggest, x => x.AgreeNum, OrderByType.Desc)
|
||||||
.LeftJoin<UserEntity>((discuss, user) => discuss.CreatorId==user.Id)
|
.LeftJoin<UserEntity>((discuss, user) => discuss.CreatorId == user.Id)
|
||||||
.Select((discuss,user) =>new DiscussGetListOutputDto {
|
.Select((discuss, user) => new DiscussGetListOutputDto
|
||||||
User=new UserGetListOutputDto() { UserName=user.UserName,Nick=user.Nick, Icon = user.Icon }
|
{
|
||||||
},true)
|
Id=discuss.Id,
|
||||||
|
IsAgree = SqlFunc.Subqueryable<AgreeEntity>().Where(x => x.CreatorId == _currentUser.Id && x.DiscussId == discuss.Id).Any(),
|
||||||
|
User = new UserGetListOutputDto() { UserName = user.UserName, Nick = user.Nick, Icon = user.Icon }
|
||||||
|
}, true)
|
||||||
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||||
return new PagedResultDto<DiscussGetListOutputDto>(total, items);
|
return new PagedResultDto<DiscussGetListOutputDto>(total, items);
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user