main
parent
6760d3ffe8
commit
6d5f0874bb
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.app.domain.vo.AppUserFriendVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -48,23 +49,23 @@ public class AppUserFriendController extends BaseController
|
|||
public TableDataInfo list(AppUserFriend appUserFriend)
|
||||
{
|
||||
startPage();
|
||||
List<AppUserFriend> list = appUserFriendService.selectAppUserFriendList(appUserFriend);
|
||||
List<AppUserFriendVo> list = appUserFriendService.selectAppUserFriendList(appUserFriend);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户好友列表
|
||||
*/
|
||||
@RequiresPermissions("app:friend:export")
|
||||
/* @RequiresPermissions("app:friend:export")
|
||||
@Log(title = "用户好友", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ApiOperation(value = "导出用户好友列表", notes = "导出用户好友列表", httpMethod = "POST")
|
||||
public void export(HttpServletResponse response, AppUserFriend appUserFriend)
|
||||
{
|
||||
List<AppUserFriend> list = appUserFriendService.selectAppUserFriendList(appUserFriend);
|
||||
List<AppUserFriendVo> list = appUserFriendService.selectAppUserFriendList(appUserFriend);
|
||||
ExcelUtil<AppUserFriend> util = new ExcelUtil<AppUserFriend>(AppUserFriend.class);
|
||||
util.exportExcel(response, list, "用户好友数据");
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 获取用户好友详细信息
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
package com.ruoyi.app.domain.vo;
|
||||
|
||||
import com.ruoyi.app.domain.AppUserFriend;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 用户好友对象 app_user_friend
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public class AppUserFriendVo extends AppUserFriend
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 我的id */
|
||||
@Excel(name = "名字")
|
||||
private String username;
|
||||
|
||||
/** 好友id */
|
||||
@Excel(name = "头像")
|
||||
private String avatarUrl;
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setAvatarUrl(String avatarUrl) {
|
||||
this.avatarUrl = avatarUrl;
|
||||
}
|
||||
|
||||
public String getAvatarUrl() {
|
||||
return avatarUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("friendId", getFriendId())
|
||||
.append("status", getStatus())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.app.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppUserFriend;
|
||||
import com.ruoyi.app.domain.vo.AppUserFriendVo;
|
||||
|
||||
/**
|
||||
* 用户好友Mapper接口
|
||||
|
|
@ -26,6 +27,7 @@ public interface AppUserFriendMapper
|
|||
* @return 用户好友集合
|
||||
*/
|
||||
public List<AppUserFriend> selectAppUserFriendList(AppUserFriend appUserFriend);
|
||||
public List<AppUserFriendVo> selectFriendList(AppUserFriend appUserFriend);
|
||||
|
||||
/**
|
||||
* 新增用户好友
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.app.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppUserFriend;
|
||||
import com.ruoyi.app.domain.vo.AppUserFriendVo;
|
||||
|
||||
/**
|
||||
* 用户好友Service接口
|
||||
|
|
@ -25,7 +26,7 @@ public interface IAppUserFriendService
|
|||
* @param appUserFriend 用户好友
|
||||
* @return 用户好友集合
|
||||
*/
|
||||
public List<AppUserFriend> selectAppUserFriendList(AppUserFriend appUserFriend);
|
||||
public List<AppUserFriendVo> selectAppUserFriendList(AppUserFriend appUserFriend);
|
||||
|
||||
/**
|
||||
* 新增用户好友
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.app.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.app.domain.vo.AppUserFriendVo;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -39,9 +41,9 @@ public class AppUserFriendServiceImpl implements IAppUserFriendService
|
|||
* @return 用户好友
|
||||
*/
|
||||
@Override
|
||||
public List<AppUserFriend> selectAppUserFriendList(AppUserFriend appUserFriend)
|
||||
public List<AppUserFriendVo> selectAppUserFriendList(AppUserFriend appUserFriend)
|
||||
{
|
||||
return appUserFriendMapper.selectAppUserFriendList(appUserFriend);
|
||||
return appUserFriendMapper.selectFriendList(appUserFriend);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -30,6 +30,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFriendList" parameterType="AppUserFriend" resultType="com.ruoyi.app.domain.vo.AppUserFriendVo">
|
||||
select a.id as "id",a.user_id as "userId",a.friend_id as "friendId",a.status as "status",a.create_time as "createTime",
|
||||
u.username as "username",
|
||||
u.avatar_url as "avatarUrl"
|
||||
from app_user_friend a
|
||||
left join app_user u on u.id = a.friend_id
|
||||
<where>
|
||||
<if test="userId != null "> and a.user_id = #{userId}</if>
|
||||
<if test="friendId != null "> and a.friend_id = #{friendId}</if>
|
||||
<if test="status != null "> and a.status = #{status}</if>
|
||||
<if test="updateBy != null and updateBy != ''"> and a.updateBy = #{updateBy}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppUserFriendById" parameterType="Long" resultMap="AppUserFriendResult">
|
||||
<include refid="selectAppUserFriendVo"/>
|
||||
where id = #{id}
|
||||
|
|
|
|||
Loading…
Reference in New Issue