Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
35e8ee06
Commit
35e8ee06
authored
May 27, 2021
by
李成龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
ec6a3af6
9f24b314
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
165 additions
and
3 deletions
+165
-3
SwaggerConfig.java
.../java/org/amos/boot/biz/common/configs/SwaggerConfig.java
+55
-0
BaseMapper.java
.../java/org/amos/boot/biz/common/dao/mapper/BaseMapper.java
+11
-0
BaseDao.java
...java/org/amos/boot/biz/common/dao/repository/BaseDao.java
+37
-0
BaseEntity.java
...main/java/org/amos/boot/biz/common/entity/BaseEntity.java
+39
-0
RedisUtils.java
.../main/java/org/amos/boot/biz/common/utils/RedisUtils.java
+1
-0
TestController.java
...g/amos/boot/module/tzs/biz/controller/TestController.java
+7
-0
AmosTzsApplication.java
...em/src/main/java/com/yeejoin/amos/AmosTzsApplication.java
+4
-3
pom.xml
pom.xml
+11
-0
No files found.
amos-boot-biz-common/src/main/java/org/amos/boot/biz/common/configs/SwaggerConfig.java
0 → 100644
View file @
35e8ee06
package
org
.
amos
.
boot
.
biz
.
common
.
configs
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.Contact
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
/**
* swagger配置类 模块如果需要引入则引入
*
* @author DELL
*/
@Configuration
@EnableSwagger2
public
class
SwaggerConfig
{
@Bean
public
Docket
api
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
groupName
(
"服务接口"
)
.
enable
(
true
)
.
apiInfo
(
apiInfo
())
.
select
()
.
apis
(
RequestHandlerSelectors
.
withMethodAnnotation
(
ApiOperation
.
class
))
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"org.amos.boot"
))
.
paths
(
PathSelectors
.
any
())
.
build
();
}
/**
* 构建 api文档的详细信息函数,注意这里的注解引用的是哪个
*/
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
//页面标题
.
title
(
"RestFul API"
)
//创建人
.
contact
(
new
Contact
(
"amos"
,
""
,
""
))
//版本号
.
version
(
"1.0"
)
//描述
.
description
(
"API 描述"
)
.
build
();
}
}
\ No newline at end of file
amos-boot-biz-common/src/main/java/org/amos/boot/biz/common/dao/mapper/BaseMapper.java
0 → 100644
View file @
35e8ee06
package
org
.
amos
.
boot
.
biz
.
common
.
dao
.
mapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* MyBatis BaseMapper
* @author DELL
*/
@Mapper
public
interface
BaseMapper
{
}
amos-boot-biz-common/src/main/java/org/amos/boot/biz/common/dao/repository/BaseDao.java
0 → 100644
View file @
35e8ee06
package
org
.
amos
.
boot
.
biz
.
common
.
dao
.
repository
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.repository.CrudRepository
;
import
org.springframework.data.repository.NoRepositoryBean
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 基础dao
*
* @author DELL
* @param <T>
* @param <ID>
*/
@NoRepositoryBean
public
interface
BaseDao
<
T
,
ID
extends
Serializable
>
extends
JpaRepository
<
T
,
ID
>,
CrudRepository
<
T
,
ID
>,
PagingAndSortingRepository
<
T
,
ID
>,
JpaSpecificationExecutor
<
T
>
{
/**
* 查询
* @param specification
* @return
*/
public
default
T
getOneBySpecification
(
Specification
<
T
>
specification
)
{
List
<
T
>
list
=
findAll
(
specification
);
if
(
list
.
isEmpty
())
{
return
null
;
}
else
{
return
list
.
get
(
0
);
}
}
}
amos-boot-biz-common/src/main/java/org/amos/boot/biz/common/entity/BaseEntity.java
0 → 100644
View file @
35e8ee06
package
org
.
amos
.
boot
.
biz
.
common
.
entity
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 公共实体类
*
* @author DELL
*/
@Data
public
class
BaseEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 唯一主键
*/
@TableId
(
type
=
IdType
.
ID_WORKER
)
private
Long
id
;
/**
* 创建时间
*/
@TableField
(
value
=
"create_date"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createDate
;
/**
* 更新时间
*/
@TableField
(
value
=
"update_date"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
private
Date
updateDate
;
}
amos-boot-biz-common/src/main/java/org/amos/boot/biz/common/utils/RedisUtils.java
View file @
35e8ee06
...
@@ -11,6 +11,7 @@ import java.util.concurrent.TimeUnit;
...
@@ -11,6 +11,7 @@ import java.util.concurrent.TimeUnit;
/**
/**
* @author DELL
* @author DELL
*/
*/
@Component
public
class
RedisUtils
{
public
class
RedisUtils
{
@Autowired
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/org/amos/boot/module/tzs/biz/controller/TestController.java
View file @
35e8ee06
package
org
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
package
org
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
io.swagger.annotations.ApiOperation
;
import
org.amos.boot.biz.common.controller.BaseController
;
import
org.amos.boot.biz.common.controller.BaseController
;
import
org.amos.boot.biz.common.utils.CommonResponseUtil
;
import
org.amos.boot.biz.common.utils.CommonResponseUtil
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
/**
* @author DELL
*/
@RestController
@RestController
@RequestMapping
(
"/test"
)
@RequestMapping
(
"/test"
)
public
class
TestController
extends
BaseController
{
public
class
TestController
extends
BaseController
{
@ApiOperation
(
value
=
"测试接口"
)
@GetMapping
(
value
=
"/testGet"
)
public
ResponseModel
test
()
{
public
ResponseModel
test
()
{
return
CommonResponseUtil
.
success
();
return
CommonResponseUtil
.
success
();
}
}
...
...
amos-boot-tzs-system/src/main/java/com/yeejoin/amos/AmosTzsApplication.java
View file @
35e8ee06
...
@@ -25,7 +25,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
...
@@ -25,7 +25,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
*
*
* @author DELL
* @author DELL
*/
*/
@SpringBootApplication
@EnableTransactionManagement
@EnableTransactionManagement
@EnableConfigurationProperties
@EnableConfigurationProperties
@EnableSwagger2
@EnableSwagger2
...
@@ -38,7 +38,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
...
@@ -38,7 +38,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
})
"org.typroject.tyboot.component.*.face.orm.dao*"
})
@
SpringBootApplication
(
scanBasePackages
=
{
"com.yeejoin.amos"
,
"org.typroject"
})
@
ComponentScan
(
basePackages
=
{
"org.amos.boot"
,
"org.typroject"
,
"com.yeejoin.amos"
})
public
class
AmosTzsApplication
{
public
class
AmosTzsApplication
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AmosTzsApplication
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AmosTzsApplication
.
class
);
...
@@ -51,6 +51,7 @@ public class AmosTzsApplication {
...
@@ -51,6 +51,7 @@ public class AmosTzsApplication {
+
" has already been started in "
+
" has already been started in "
+
environment
.
getProperty
(
"spring.profiles.active"
)
+
""
+
environment
.
getProperty
(
"spring.profiles.active"
)
+
""
+
" environment,and service's url is 'http://localhost:"
+
" environment,and service's url is 'http://localhost:"
+
environment
.
getProperty
(
"server.port"
)
+
"/swagger-ui.html'"
);
+
environment
.
getProperty
(
"server.port"
)
+
environment
.
getProperty
(
"server.servlet.context-path"
)
+
"/swagger-ui.html'"
);
}
}
}
}
pom.xml
View file @
35e8ee06
...
@@ -457,6 +457,17 @@
...
@@ -457,6 +457,17 @@
</exclusion>
</exclusion>
</exclusions>
</exclusions>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.apache.tomcat
</groupId>
<artifactId>
tomcat-jdbc
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencies>
<dependencyManagement>
<dependencyManagement>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment