Changes
This commit is contained in:
parent
8c936791c3
commit
78f8d06727
@ -7,7 +7,7 @@
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="forum" />
|
||||
<module name="forum-backend" />
|
||||
<module name="doubao_community_backend-master" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
@ -19,7 +19,7 @@
|
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||
<module name="doubao" options="-parameters" />
|
||||
<module name="doubao_community_backend-master" options="-parameters" />
|
||||
<module name="forum" options="-parameters" />
|
||||
<module name="forum-backend" options="-parameters" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -14,7 +14,7 @@
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="9" project-jdk-type="JavaSDK" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="jpab" />
|
||||
</component>
|
||||
|
2
pom.xml
2
pom.xml
@ -9,7 +9,7 @@
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.yovinchen</groupId>
|
||||
<artifactId>forum</artifactId>
|
||||
<artifactId>forum-backend</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>doubao</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
|
@ -1,12 +1,5 @@
|
||||
package com.yovinchen.forum.config;
|
||||
|
||||
/**
|
||||
* ClassName: config
|
||||
* Package: com.yovinchen.forum.config
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/6/14 16:51
|
||||
*/
|
||||
|
||||
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@ -20,6 +13,13 @@ import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* ClassName: config
|
||||
* Package: com.yovinchen.forum.config
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/6/14 16:51
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
@EnableKnife4j
|
||||
|
@ -1,11 +0,0 @@
|
||||
package com.yovinchen.forum.controller;
|
||||
|
||||
/**
|
||||
* ClassName: GiteeLogin
|
||||
* Package: com.yovinchen.forum.controller
|
||||
* /oauth/callback
|
||||
* @author yovinchen
|
||||
* @Create 2023/6/14 20:11
|
||||
*/
|
||||
public class GiteeLogin {
|
||||
}
|
@ -22,6 +22,7 @@ import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@Api(tags = "用户管理接口")
|
||||
@RestController
|
||||
@ -75,7 +76,13 @@ public class UmsUserController extends BaseController {
|
||||
Map<String, Object> map = new HashMap<>(16);
|
||||
UmsUser user = iUmsUserService.getUserByUsername(username);
|
||||
Assert.notNull(user, "用户不存在");
|
||||
Page<BmsPost> page = iBmsPostService.page(new Page<>(pageNo, size), new LambdaQueryWrapper<BmsPost>().eq(BmsPost::getUserId, user.getId()));
|
||||
Page<BmsPost> page;
|
||||
if (Objects.equals(user.getUsername(), "admin")) {
|
||||
page = iBmsPostService.page(new Page<>(pageNo, size), null);
|
||||
} else {
|
||||
page = iBmsPostService.page(new Page<>(pageNo, size), new LambdaQueryWrapper<BmsPost>().eq(BmsPost::getUserId, user.getId()));
|
||||
|
||||
}
|
||||
map.put("user", user);
|
||||
map.put("topics", page);
|
||||
return ApiResult.success(map);
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user