Commit 0043994e by 段启岩

Merge remote-tracking branch 'origin/humingsen'

parents c9cd4ffe 45eefffe
...@@ -41,7 +41,7 @@ public class TopicApi { ...@@ -41,7 +41,7 @@ public class TopicApi {
@PostMapping("/topic") @PostMapping("/topic")
public Response createTopic(@RequestBody @Valid CreateTopicForm createTopicForm, @CurrentSubject Subject subject){ public Response createTopic(@RequestBody @Valid CreateTopicForm createTopicForm, @CurrentSubject Subject subject){
iTopicService.createTopic(String.valueOf(subject.getId()), createTopicForm.getTopicName(), createTopicForm.getTopicIcon(), createTopicForm.getCover(), createTopicForm.getTopicDescrption(), createTopicForm.getReferenceCount()); iTopicService.createTopic(String.valueOf(subject.getId()), createTopicForm.getTopicName());
return Response.success(); return Response.success();
} }
......
...@@ -18,16 +18,4 @@ public class CreateTopicForm { ...@@ -18,16 +18,4 @@ public class CreateTopicForm {
@NotEmpty(message = "话题名称不能为空") @NotEmpty(message = "话题名称不能为空")
private String topicName; private String topicName;
@ApiModelProperty("话题图标")
private String topicIcon;
@ApiModelProperty("封面图")
private String cover;
@ApiModelProperty("话题描述")
private String topicDescrption;
@ApiModelProperty("话题被引用的次数")
private int referenceCount;
} }
...@@ -16,14 +16,10 @@ public interface ITopicService extends IService<Topic> { ...@@ -16,14 +16,10 @@ public interface ITopicService extends IService<Topic> {
/** /**
* 创建话题 * 创建话题
* @param id * @param userId
* @param topicName * @param topicName
* @param topicIcon
* @param cover
* @param topicDescrption
* @param referenceCount
*/ */
void createTopic(String id, String topicName, String topicIcon, String cover, String topicDescrption, int referenceCount); void createTopic(String userId, String topicName);
/** /**
* 检索话题 * 检索话题
......
...@@ -35,15 +35,12 @@ public class TopicServiceImpl extends ServiceImpl<TopicMapper, Topic> implements ...@@ -35,15 +35,12 @@ public class TopicServiceImpl extends ServiceImpl<TopicMapper, Topic> implements
} }
@Override @Override
public void createTopic(String id, String topicName, String topicIcon, String cover, String topicDescrption, int referenceCount) { public void createTopic(String userId, String topicName) {
//1. 创建话题 //1. 创建话题
Topic topic=new Topic(); Topic topic=new Topic();
topic.setUserId(id); topic.setUserId(userId);
topic.setTopicName(topicName); topic.setTopicName(topicName);
topic.setTopicIcon(topicIcon);
topic.setCover(cover);
topic.setTopicDescrption(topicDescrption);
iTopicService.save(topic); iTopicService.save(topic);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment