feat: 开发中...
This commit is contained in:
@@ -15,23 +15,23 @@ public class AttachController {
|
||||
return ResponseVO.success();
|
||||
}
|
||||
|
||||
@PutMapping("/{attachID}/")
|
||||
public ResponseVO<Void> modifyAttach(@PathVariable String attachID, @RequestBody MultipartFile file) {
|
||||
return ResponseVO.success();
|
||||
}
|
||||
|
||||
@GetMapping("/{attachID}/")
|
||||
public ResponseVO<Void> getAttach(@PathVariable String attachID) {
|
||||
return ResponseVO.success();
|
||||
}
|
||||
|
||||
@DeleteMapping("/{attachID}/")
|
||||
public ResponseVO<Void> deleteAttach(@PathVariable String attachID) {
|
||||
return ResponseVO.success();
|
||||
}
|
||||
|
||||
@GetMapping("/")
|
||||
public ResponseVO<Void> getAttachList() {
|
||||
return ResponseVO.success();
|
||||
}
|
||||
|
||||
@PutMapping("/{attachID}/")
|
||||
public ResponseVO<Void> modifyAttach(@PathVariable String attachID, @RequestBody MultipartFile file) {
|
||||
return ResponseVO.success();
|
||||
}
|
||||
|
||||
@DeleteMapping("/{attachID}/")
|
||||
public ResponseVO<Void> deleteAttach(@PathVariable String attachID) {
|
||||
return ResponseVO.success();
|
||||
}
|
||||
}
|
||||
|
@@ -1,10 +1,8 @@
|
||||
package cn.hamster3.application.blog.dao;
|
||||
|
||||
import cn.hamster3.application.blog.entity.BlogEntity;
|
||||
import org.springframework.data.jpa.repository.EntityGraph;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.jpa.repository.*;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -12,4 +10,9 @@ public interface BlogRepository extends JpaRepository<BlogEntity, Long>, JpaSpec
|
||||
@EntityGraph(attributePaths = {"content"})
|
||||
@Query("select b from BlogEntity b where b.id = ?1")
|
||||
Optional<BlogEntity> findByIDWithContent(Long id);
|
||||
|
||||
@Transactional
|
||||
@Modifying
|
||||
@Query("update BlogEntity b set b.title = ?1, b.abstracts = ?2, b.password = ?3, b.content = ?4 where b.id = ?5")
|
||||
void updateTitleAndAbstractsAndPasswordAndContentById(String title, String abstracts, String password, String content, Long id);
|
||||
}
|
@@ -67,9 +67,13 @@ public class BlogService implements IBlogService {
|
||||
return ResponseVO.failed("not login.");
|
||||
}
|
||||
//todo 权限检查
|
||||
BlogEntity entity = blogMapper.voToEntity(requireVO);
|
||||
entity.setId(blogID);
|
||||
blogRepo.save(entity);
|
||||
blogRepo.updateTitleAndAbstractsAndPasswordAndContentById(
|
||||
requireVO.getTitle(),
|
||||
requireVO.getAbstracts(),
|
||||
requireVO.getPassword(),
|
||||
requireVO.getContent(),
|
||||
blogID
|
||||
);
|
||||
return ResponseVO.success();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user