<?xml version="1.0"encoding="UTF‐8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="
http://www.w3.org/2001/XMLSchema‐instance"xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven‐4.0.0.xsd">
<parent>
<artifactId>xc‐framework‐
parent</artifactId>
<groupId>com.xuecheng</groupId>
<version>1.0‐SNAPSHOT</version>
<relativePath>../xc‐framework‐
parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>xc‐service‐manage‐
cms</artifactId>
<dependencies>
<dependency>
<groupId>com.xuecheng</groupId>
<artifactId>xc‐service‐
api</artifactId>
<version>1.0‐
SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.xuecheng</groupId>
<artifactId>xc
‐
framework
‐
model</artifactId>
<version>1.0
‐
SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.xuecheng</groupId>
<artifactId>xc
‐
framework
‐
utils</artifactId>
<version>1.0
‐
SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.xuecheng</groupId>
<artifactId>xc
‐
framework
‐
common</artifactId>
<version>1.0
‐
SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org
.springframework.boot</groupId>
<artifactId>spring
‐
boot
‐
starter
‐
web</artifactId>
</dependency>
<dependency>
<groupId>org
.springframework.boot</groupId>
<artifactId>spring
‐
boot
‐
starter
‐
freemarker</artifactId>
</dependency>
<dependency>
<groupId>org
.springframework.boot</groupId>
<artifactId>spring
‐
boot
‐
starter
‐
data
‐
mongodb</artifactId>
</dependency>
<dependency>
<groupId>org
.springframework.boot</groupId>
<artifactId>spring
‐
boot
‐
starter
‐
amqp</artifactId>
</dependency>
<dependency>
<groupId>com.squareup
.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<groupId>org
.springframework.boot</groupId>
<artifactId>spring
‐
boot
‐
starter
‐
test</artifactId>
</dependency>
</dependencies>
</project>
<dependency>
<groupId>org
.springframework.boot</groupId>
<artifactId>spring
‐
boot
‐
starter
‐
data
‐
mongodb</artifactId>
</dependency>
server:
port: 31001
spring:
application:
name: xc‐service‐manage‐cms
data:mongodb:
uri: mongodb://root:123@localhost:27017
database: xc_cms
@SpringBootApplication
@EntityScan(
"
com.xuecheng
.framework.domain.cms
"
)//扫描实体类
@ComponentScan(basePackages
=
{
"
com.xuecheng
.api
"
})//扫描接口
@ComponentScan(basePackages
=
{
"
com.xuecheng
.manage_cms
"
})//扫描本项目下的所有类
public class ManageCmsApplication {
public static void main(String[] args) {
SpringApplication.run(ManageCmsApplication.class,args);
}
}
package com.xuecheng
.manage_cms.web.controller;
import com.xuecheng
.api.cms.CmsPageControllerApi;
import com.xuecheng
.framework.domain.cms.request.
QueryPageRequest;
import com.xuecheng
.framework.model.response.
QueryResponseResult;
import com.xuecheng
.manage_cms.service.PageService;
import org
.springframework.beans.factory
.annotation.Autowired;
import org
.springframework.web.bind.annotation.PathVariable;
import org
.springframework.web.bind.annotation.RestController;
@RestController
public class CmsPageController implements CmsPageControllerApi {
@Override
@GetMapping(
"
/list/{page}/{size}
"
)
public QueryResponseResult findList(@PathVariable(
"
page
"
) int page,@PathVariable(
"
size
"
) int
size,QueryPageRequest queryPageRequest) {
//暂时采用测试数据,测试接口是否可以正常运行
QueryResult queryResult
= new QueryResult();
queryResult.setTotal(2);
//静态数据列表
List list
= new ArrayList();
CmsPage cmsPage
= new CmsPage();
cmsPage.setPageName(
"
测试页面
"
);
list.add(cmsPage)
queryResult.setList(list);
QueryResponseResult queryResponseResult
= new
QueryResponseResult(CommonCode.SUCCESS,queryResult);
return queryResponseResult;
}
}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |