提交 54ec73fc authored 作者: Whispa's avatar Whispa

commit

上级 db20ddd4
......@@ -30,6 +30,8 @@ public class HashtagController {
@PostMapping(value = "/saveHashTag")
public Hashtag saveProduct(@ModelAttribute("Hashtag") Hashtag hashtag) {
if( repository.existsByName(hashtag.getName()))
return hashtag;
return repository.save(hashtag);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论