Commit d54b932c by 胡明森

我的话题列表

parent d59d9d2c
......@@ -127,4 +127,19 @@ public class TopicApi {
return Response.success(page);
}
/**
* 我创建的话题列表
* @param pageForm
* @return
*/
@ApiOperation("我的话题列表")
@GetMapping("/my/topic/created")
public Response<PageVO<Topic>> getMyTopics(@Valid PageForm pageForm, @CurrentSubject Subject subject) {
// 根据用户获取列表并返回
IPage<Topic> topicPage = topicService.getProjectPage(pageForm.getPage(), pageForm.getSize(), (String) subject.getId());
PageVO<Topic> topicPageVO = new PageVO<>(topicPage);
return Response.success(topicPageVO);
}
}
......@@ -63,4 +63,6 @@ public interface ITopicService extends IService<Topic> {
* @return
*/
IPage<User> getTopicsFollower(Integer page, Integer size, String topicId);
IPage<Topic> getProjectPage(Integer page, Integer size, String userId);
}
......@@ -175,5 +175,13 @@ public class TopicServiceImpl extends ServiceImpl<TopicMapper, Topic> implements
return userPage;
}
@Override
public IPage<Topic> getProjectPage(Integer pageNumber, Integer pageSize, String userId) {
IPage<Topic> page = new Page<>(pageNumber, pageSize);
QueryWrapper<Topic> topicQueryWrapper = new QueryWrapper<>();
topicQueryWrapper.eq("user_id", userId);
return page(page, topicQueryWrapper);
}
}
......@@ -3,7 +3,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/beyond_clouds?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 197442
password: password
swagger:
enable: true
......@@ -33,3 +33,5 @@ beyondclouds:
client-id: 101846021
client-secret: 5bc41deeb7e152e2e6aff97726bbf86a
redirect-uri: http://meteor.natapp1.cc/auth/qq
server:
port: 8081
\ No newline at end of file
......@@ -3,7 +3,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/beyond_clouds?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 100Centa30821%mysql
password: password
swagger:
enable: true
......@@ -33,3 +33,5 @@ beyondclouds:
client-id: 101846021
client-secret: 5bc41deeb7e152e2e6aff97726bbf86a
redirect-uri: http://meteor.natapp1.cc/auth/qq
server:
port: 8081
\ No newline at end of file
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