接口的修改
This commit is contained in:
parent
f76e098175
commit
7153a8ca0c
|
|
@ -1558,6 +1558,7 @@ Authorization: Bearer <token>
|
||||||
{
|
{
|
||||||
"title": "我的作品标题",
|
"title": "我的作品标题",
|
||||||
"description": "作品描述内容",
|
"description": "作品描述内容",
|
||||||
|
"type": "VIDEO",
|
||||||
"coverUrl": "https://example.com/cover.jpg",
|
"coverUrl": "https://example.com/cover.jpg",
|
||||||
"videoUrl": "https://example.com/video.mp4",
|
"videoUrl": "https://example.com/video.mp4",
|
||||||
"categoryId": 1,
|
"categoryId": 1,
|
||||||
|
|
@ -1603,6 +1604,7 @@ Authorization: Bearer <token>
|
||||||
{
|
{
|
||||||
"id": 10001,
|
"id": 10001,
|
||||||
"title": "修改后的标题",
|
"title": "修改后的标题",
|
||||||
|
"type": "VIDEO",
|
||||||
"description": "修改后的描述",
|
"description": "修改后的描述",
|
||||||
"coverUrl": "https://example.com/new-cover.jpg",
|
"coverUrl": "https://example.com/new-cover.jpg",
|
||||||
"categoryId": 2,
|
"categoryId": 2,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.zbkj.common.model.friend;
|
package com.zbkj.common.model.friend;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
|
@ -55,11 +57,13 @@ public class FriendRequest implements Serializable {
|
||||||
private Integer status = 0;
|
private Integer status = 0;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
@Column(name = "create_time", nullable = false, updatable = false)
|
@Column(name = "create_time", nullable = false, updatable = false)
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "处理时间")
|
@ApiModelProperty(value = "处理时间")
|
||||||
|
@TableField(fill = FieldFill.UPDATE)
|
||||||
@Column(name = "update_time")
|
@Column(name = "update_time")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
|
||||||
|
|
@ -28,4 +28,12 @@ public interface FriendRequestDao extends BaseMapper<FriendRequest> {
|
||||||
* 检查是否已发送过请求
|
* 检查是否已发送过请求
|
||||||
*/
|
*/
|
||||||
Long checkExistingRequest(@Param("fromUserId") Integer fromUserId, @Param("toUserId") Integer toUserId);
|
Long checkExistingRequest(@Param("fromUserId") Integer fromUserId, @Param("toUserId") Integer toUserId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入好友请求(自定义插入,避免字段冲突)
|
||||||
|
*/
|
||||||
|
int insertFriendRequest(@Param("fromUserId") Integer fromUserId,
|
||||||
|
@Param("toUserId") Integer toUserId,
|
||||||
|
@Param("message") String message,
|
||||||
|
@Param("status") Integer status);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,13 +94,8 @@ public class FriendServiceImpl implements FriendService {
|
||||||
throw new CrmebException("已发送过好友请求,请等待对方处理");
|
throw new CrmebException("已发送过好友请求,请等待对方处理");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 插入好友请求
|
// 插入好友请求 - 使用自定义插入方法避免字段冲突
|
||||||
FriendRequest friendRequest = new FriendRequest();
|
friendRequestDao.insertFriendRequest(currentUserId, targetUserId, message, 0);
|
||||||
friendRequest.setFromUserId(currentUserId);
|
|
||||||
friendRequest.setToUserId(targetUserId);
|
|
||||||
friendRequest.setMessage(message);
|
|
||||||
friendRequest.setStatus(0);
|
|
||||||
friendRequestDao.insert(friendRequest);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,4 +35,10 @@
|
||||||
AND status = 0
|
AND status = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 插入好友请求(明确指定字段,避免字段冲突) -->
|
||||||
|
<insert id="insertFriendRequest">
|
||||||
|
INSERT INTO eb_friend_request (from_user_id, to_user_id, target_uid, message, status, create_time)
|
||||||
|
VALUES (#{fromUserId}, #{toUserId}, #{toUserId}, #{message}, #{status}, NOW())
|
||||||
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user