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