linhw 2024-05-22 16:10:51 +08:00
parent 120d761d89
commit 2983d06fb3
11 changed files with 74 additions and 13 deletions

View File

@ -2,6 +2,7 @@ package com.ruoyi.app.controller;
import java.util.List;
import java.io.IOException;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.app.domain.vo.AppDynamicCommentVo;
@ -117,9 +118,9 @@ public class AppDynamicCommentController extends BaseController
// @RequiresPermissions("app:comment:list")
@GetMapping("/treeList")
@ApiOperation(value = "评论树列表", notes = "评论树列表", httpMethod = "GET")
public TableDataInfo treeList(AppDynamicComment appDynamicComment) {
public AjaxResult treeList(AppDynamicComment appDynamicComment) {
startPage();
List<AppDynamicCommentVo> list = appDynamicCommentService.treeList(appDynamicComment);
return getDataTable(list);
Map list = appDynamicCommentService.treeList(appDynamicComment);
return AjaxResult.success(list);
}
}

View File

@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@RestController
@RequestMapping("/api/oss")
@ -26,6 +27,13 @@ public class OssController {
return ossService.uploadFile(file);
}
@PostMapping("uploadList")
@ApiOperation(value = "上传文件" , notes = "上传文件", produces = "file" , response = R.class)
public R uploadFile(@RequestBody List<MultipartFile> files, HttpServletRequest request
) {
return ossService.uploadFile(files);
}
//2、删除oss中的文件
@DeleteMapping("delete")
@ApiOperation("删除文件")

View File

@ -40,7 +40,6 @@ public class UserSkillController extends BaseController
/**
*
*/
@RequiresPermissions("app:skill:list")
@GetMapping("/list")
public TableDataInfo list(UserSkill userSkill)
{

View File

@ -12,7 +12,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* app app_user
*
* jobEndTime jobName jobType jobContent hobby city other
* @author wyh
* @date 2024-04-23
*/

View File

@ -41,6 +41,9 @@ public class AppUserDynamicVo extends AppUserDynamic
@Excel(name = "专业")
private String major;
@Excel(name = "昵称")
private String nickname;
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "学历开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
@ -58,6 +61,11 @@ public class AppUserDynamicVo extends AppUserDynamic
private String cityName;
private String provinceName;
private String townName;
// 话题
private List<AppTopic> appTopicList = new ArrayList<>();

View File

@ -19,6 +19,7 @@ public interface AppUserDynamicMapper
* @return App
*/
public AppUserDynamic selectAppUserDynamicById(Long id);
public AppUserDynamicVo selectcById(Long id);
/**
* App

View File

@ -1,6 +1,8 @@
package com.ruoyi.app.service;
import java.util.List;
import java.util.Map;
import com.ruoyi.app.domain.AppDynamicComment;
import com.ruoyi.app.domain.vo.AppDynamicCommentVo;
import com.ruoyi.common.core.web.domain.AjaxResult;
@ -61,6 +63,6 @@ public interface IAppDynamicCommentService
*/
public int deleteAppDynamicCommentById(Long id);
public List<AppDynamicCommentVo> treeList(AppDynamicComment appDynamicComment);
public Map treeList(AppDynamicComment appDynamicComment);
}

View File

@ -1,7 +1,9 @@
package com.ruoyi.app.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.ruoyi.app.domain.AppUser;
@ -119,14 +121,17 @@ public class AppDynamicCommentServiceImpl implements IAppDynamicCommentService
}
@Override
public List<AppDynamicCommentVo> treeList(AppDynamicComment appDynamicComment) {
public Map treeList(AppDynamicComment appDynamicComment) {
Map<String,Object> map = new HashMap<>();
if (appDynamicComment.getDynamicId() == null) {
return new ArrayList<>();
return map;
}
List<AppDynamicCommentVo> appDynamicComments = appDynamicCommentMapper.selectCommentList(appDynamicComment);
List<AppDynamicCommentVo> parentList = appDynamicComments.stream().filter(entity -> entity.getParentId() == null).collect(Collectors.toList());
List<AppDynamicCommentVo> srcList = appDynamicComments.stream().filter(entity -> entity.getParentId() != null).collect(Collectors.toList());
return buildList(parentList,srcList);
map.put("countNum",appDynamicComments.size());
map.put("list",buildList(parentList,srcList));
return map;
}
public List<AppDynamicCommentVo> buildList(List<AppDynamicCommentVo> parentList,List<AppDynamicCommentVo> srcList){
for (AppDynamicCommentVo appDynamicCommentVo : parentList) {

View File

@ -56,7 +56,7 @@ public class AppUserDynamicServiceImpl implements IAppUserDynamicService
@Override
public AppUserDynamic selectAppUserDynamicById(Long id)
{
return appUserDynamicMapper.selectAppUserDynamicById(id);
return appUserDynamicMapper.selectcById(id);
}
/**
@ -156,6 +156,9 @@ public class AppUserDynamicServiceImpl implements IAppUserDynamicService
List<AppUserCollect> appUserCollects = appUserCollectMapper.selectAppUserCollectList(appUserCollect);
appUserDynamic.setIds(appUserCollects.stream().map(x->x.getDynamicId()).collect(Collectors.toList()));
}
if (appUserDynamic.getAppId() == null) {
appUserDynamic.setPrivacyStatus(0l);
}
List<AppUserDynamicVo> list = appUserDynamicMapper.selectDynamicList(appUserDynamic);
for (AppUserDynamicVo appUserDynamicVo : list) {
Long id = appUserDynamicVo.getId();

View File

@ -54,14 +54,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.town_id as "townId",
a.province_id as "provinceId",
a.city_id as "cityId",
t.name as "cityName"
c.name as "cityName",
t.name as "townName",
p.name as "provinceName"
from app_user_dynamic a
left join app_user u on u.id = a.user_id
left join app_town t on t.id = a.address
left join app_city c on c.id = a.city_id
left join app_province p on p.id = a.province_id
left join app_town t on t.id = a.town_id
<where>
<if test="userId != null "> and a.user_id = #{userId}</if>
<if test="username != null "> and u.username like concat('%',#{username},'%')</if>
<if test="content != null and content != ''"> and a.content = #{content}</if>
<if test="content != null and content != ''"> and a.content like concat('%',#{content},'%')</if>
<if test="videoUrl != null and videoUrl != ''"> and a.video_url = #{videoUrl}</if>
<if test="topicId != null "> and a.topic_id like concat('%',#{topicId},'%')</if>
<if test="address != null and address != ''"> and a.address = #{address}</if>
@ -86,6 +90,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectAppUserDynamicVo"/>
where id = #{id}
</select>
<select id="selectcById" parameterType="Long" resultType="com.ruoyi.app.domain.vo.AppUserDynamicVo">
select a.id as "id",a.user_id as "userId",a.content as "content",a.video_url as "videoUrl",a.topic_id as "topicId",a.address as "address",
a.is_top as "isTop",
a.privacy_status as "privacyStatus",
u.username as "username",
u.avatar_url as "avatarUrl",
u.education as "education",
u.school as "school",
u.nickname as "nickname",
u.major as "major",
u.start_time as "startTime",
u.end_time as "endTime",
u.is_member as "isMember",
a.create_time as "createTime",
a.town_id as "townId",
a.province_id as "provinceId",
a.city_id as "cityId",
c.name as "cityName",
t.name as "townName",
p.name as "provinceName"
from app_user_dynamic a
left join app_user u on u.id = a.user_id
left join app_city c on c.id = a.city_id
left join app_province p on p.id = a.province_id
left join app_town t on t.id = a.town_id
where a.id = #{id}
</select>
<insert id="insertAppUserDynamic" parameterType="AppUserDynamic" useGeneratedKeys="true" keyProperty="id">
insert into app_user_dynamic

View File

@ -44,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="orderEndTime" column="order_end_time" />
<result property="check" column="check" />
<result property="backGroundImg" column="back_ground_img" />
<result property="jobEndTime" column="job_end_time" />
</resultMap>
<sql id="appUserColumns">
a.id as "id",
@ -318,6 +319,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyName != null">company_name = #{companyName},</if>
<if test="industry != null">industry = #{industry},</if>
<if test="jobTime != null">job_time = #{jobTime},</if>
<if test="jobEndTime != null">job_end_time = #{jobEndTime},</if>
<if test="jobName != null">job_name = #{jobName},</if>
<if test="jobType != null">job_type = #{jobType},</if>
<if test="skillId != null">skill_id = #{skillId},</if>