修复自动填充功能
This commit is contained in:
parent
6d78d5d672
commit
2e49061caa
@ -58,6 +58,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -509,10 +510,10 @@ public class AuthApi {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "创建笔记")
|
||||
@ApiOperation(value = "修改笔记")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@PostMapping("/api/auth/updateNote")
|
||||
@OperLog(operModule = "创建笔记",operType = OperType.ADD,operDesc = "创建笔记")
|
||||
@OperLog(operModule = "修改笔记",operType = OperType.ADD,operDesc = "修改笔记")
|
||||
@Transactional
|
||||
public ResultBean updateNote(@RequestBody NoteDto noteDto) {
|
||||
String authorId = String.valueOf(request.getAttribute("authorId"));
|
||||
@ -548,6 +549,17 @@ public class AuthApi {
|
||||
return ResultBean.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除笔记")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@PostMapping("/api/auth/deleteNote")
|
||||
@OperLog(operModule = "删除笔记",operType = OperType.ADD,operDesc = "删除笔记")
|
||||
@Transactional
|
||||
public ResultBean deleteNote(@RequestBody NoteDto noteDto) {
|
||||
String noteId = noteDto.getNoteId();
|
||||
noteService.removeById(noteId);
|
||||
return ResultBean.success();
|
||||
}
|
||||
|
||||
//外层倒叙 回复正序
|
||||
@ApiOperation(value = "获取笔记评论")
|
||||
@ApiOperationSupport(order = 1)
|
||||
|
@ -230,6 +230,7 @@
|
||||
) AS n
|
||||
LEFT JOIN business_author a ON n.follow_id = a.AUTHOR_ID
|
||||
LEFT JOIN business_note b ON n.note_id = b.note_id
|
||||
where n.follow_id != #{authorId}
|
||||
ORDER BY
|
||||
n.create_time DESC
|
||||
</select>
|
||||
|
@ -18,7 +18,7 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||
public void insertFill(MetaObject metaObject) {
|
||||
|
||||
log.info("start insert fill ....");
|
||||
this.strictInsertFill(metaObject, "createTime", Date.class, new Date()); // 起始版本 3.3.0(推荐使用)
|
||||
setFieldValByName("createTime",new Date(), metaObject);
|
||||
|
||||
try {
|
||||
JwtUser jwtUser = SecurityUtil.getLoginUser();
|
||||
@ -62,23 +62,22 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
log.info("start update fill ....");
|
||||
this.strictUpdateFill(metaObject, "updateTime",Date.class, new Date()); // 起始版本 3.3.0(推荐)
|
||||
setFieldValByName("updateTime",new Date(), metaObject);
|
||||
|
||||
JwtUser jwtUser = SecurityUtil.getLoginUser();
|
||||
|
||||
try {
|
||||
String updateId = String.valueOf(getFieldValByName("updateId",metaObject));
|
||||
if(StringUtil.isEmpty(updateId)){
|
||||
this.strictUpdateFill(metaObject, "updateId", String.class, jwtUser.getUserId()); // 起始版本 3.3.0(推荐使用)
|
||||
setFieldValByName("updateId",jwtUser.getUserId(), metaObject);
|
||||
}
|
||||
|
||||
String updateName = String.valueOf(getFieldValByName("updateName",metaObject));
|
||||
if(StringUtil.isEmpty(updateName)){
|
||||
this.strictUpdateFill(metaObject, "updateName", String.class, jwtUser.getUsername()); // 起始版本 3.3.0(推荐使用)
|
||||
setFieldValByName("updateName",jwtUser.getUsername(), metaObject);
|
||||
}
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
|
||||
log.error("自动填充发生错误",e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user