Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
普蓝开源社区
盘古开发框架
提交
bf207acf
盘古开发框架
项目概览
普蓝开源社区
/
盘古开发框架
通知
25
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
盘古开发框架
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bf207acf
编写于
7月 10, 2017
作者:
O
OSWorks
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
no commit message
上级
c4e1faee
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
32 addition
and
16 deletion
+32
-16
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/petstore/Application.java
.../main/java/com/aosuite/showcase/petstore/Application.java
+1
-1
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/petstore/dao/PetStoreDao.java
...n/java/com/aosuite/showcase/petstore/dao/PetStoreDao.java
+2
-2
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/petstore/dao/impl/PetStoreDaoImpl.java
...m/aosuite/showcase/petstore/dao/impl/PetStoreDaoImpl.java
+16
-0
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/petstore/service/PetStoreService.java
...om/aosuite/showcase/petstore/service/PetStoreService.java
+2
-2
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/petstore/service/impl/PetStoreServiceImpl.java
...e/showcase/petstore/service/impl/PetStoreServiceImpl.java
+6
-6
AOSuite G2/showcase/a.springboot/src/test/java/com/aosuite/showcase/test/petstore/DemoTests.java
...st/java/com/aosuite/showcase/test/petstore/DemoTests.java
+5
-5
未找到文件。
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/Application.java
→
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/
petstore/
Application.java
浏览文件 @
bf207acf
package
com.aosuite.showcase
;
package
com.aosuite.showcase
.petstore
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
...
...
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/
dao/Demo
Dao.java
→
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/
petstore/dao/PetStore
Dao.java
浏览文件 @
bf207acf
package
com.aosuite.showcase.dao
;
package
com.aosuite.showcase.
petstore.
dao
;
/**
* 数据访问对象
...
...
@@ -6,7 +6,7 @@ package com.aosuite.showcase.dao;
* @author xiongchun
*
*/
public
interface
Demo
Dao
{
public
interface
PetStore
Dao
{
/**
* 获取单价
...
...
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/
dao/impl/Demo
DaoImpl.java
→
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/
petstore/dao/impl/PetStore
DaoImpl.java
浏览文件 @
bf207acf
package
com.aosuite.showcase.dao.impl
;
package
com.aosuite.showcase.
petstore.
dao.impl
;
import
org.springframework.stereotype.Repository
;
import
com.aosuite.showcase.
dao.Demo
Dao
;
import
com.aosuite.showcase.
petstore.dao.PetStore
Dao
;
@Repository
public
class
DemoDaoImpl
implements
Demo
Dao
{
public
class
PetStoreDaoImpl
implements
PetStore
Dao
{
@Override
public
double
getPrice
()
{
...
...
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/
service/Demo
Service.java
→
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/
petstore/service/PetStore
Service.java
浏览文件 @
bf207acf
package
com.aosuite.showcase.service
;
package
com.aosuite.showcase.
petstore.
service
;
import
org.springframework.stereotype.Service
;
...
...
@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
*
*/
@Service
public
interface
Demo
Service
{
public
interface
PetStore
Service
{
/**
* 计算应付金额
...
...
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/
service/impl/Demo
ServiceImpl.java
→
AOSuite G2/showcase/a.springboot/src/main/java/com/aosuite/showcase/
petstore/service/impl/PetStore
ServiceImpl.java
浏览文件 @
bf207acf
package
com.aosuite.showcase.service.impl
;
package
com.aosuite.showcase.
petstore.
service.impl
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.aosuite.showcase.
dao.Demo
Dao
;
import
com.aosuite.showcase.
service.Demo
Service
;
import
com.aosuite.showcase.
petstore.dao.PetStore
Dao
;
import
com.aosuite.showcase.
petstore.service.PetStore
Service
;
@Service
public
class
DemoServiceImpl
implements
Demo
Service
{
public
class
PetStoreServiceImpl
implements
PetStore
Service
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
@Autowired
private
DemoDao
demo
Dao
;
private
PetStoreDao
petStore
Dao
;
@Override
public
double
getSum
(
int
quantity
){
double
price
=
demo
Dao
.
getPrice
();
double
price
=
petStore
Dao
.
getPrice
();
double
sum
=
price
*
2.5
;
logger
.
info
(
"总价:{}"
,
sum
);
return
sum
;
...
...
AOSuite G2/showcase/a.springboot/src/test/java/com/aosuite/showcase/test/DemoTests.java
→
AOSuite G2/showcase/a.springboot/src/test/java/com/aosuite/showcase/test/
petstore/
DemoTests.java
浏览文件 @
bf207acf
package
com.aosuite.showcase.test
;
package
com.aosuite.showcase.test
.petstore
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
...
...
@@ -7,7 +7,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
com.aosuite.showcase.
service.Demo
Service
;
import
com.aosuite.showcase.
petstore.service.PetStore
Service
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
DemoTests
.
class
)
...
...
@@ -15,7 +15,7 @@ import com.aosuite.showcase.service.DemoService;
public
class
DemoTests
{
@Autowired
private
DemoService
demo
Service
;
private
PetStoreService
petStore
Service
;
//测试Spring容器初始化是否成功
@Test
...
...
@@ -26,13 +26,13 @@ public class DemoTests {
//测试SpringBean注入功能
@Test
public
void
beanLoad
()
{
demo
Service
.
getSum
(
2
);
petStore
Service
.
getSum
(
2
);
}
//测试Logback日志输出功能
@Test
public
void
logback
()
{
demo
Service
.
log
();
petStore
Service
.
log
();
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录