Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
appApi
Overview
Overview
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
antaile
appApi
Commits
f7fcb70f
Commit
f7fcb70f
authored
Apr 16, 2021
by
XiaHou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
系统参数编码提交
parent
36e5a699
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
338 additions
and
49 deletions
+338
-49
pom.xml
pom.xml
+21
-2
AntaileApplication.java
src/main/java/com/hwstudio/antaile/AntaileApplication.java
+1
-1
RedisConfig.java
src/main/java/com/hwstudio/antaile/config/RedisConfig.java
+9
-7
SysAreaController.java
...om/hwstudio/antaile/controller/sys/SysAreaController.java
+1
-8
SysBaseParamController.java
...studio/antaile/controller/sys/SysBaseParamController.java
+34
-0
SysController.java
...va/com/hwstudio/antaile/controller/sys/SysController.java
+1
-1
SysBaseParamMapper.java
...a/com/hwstudio/antaile/mbg/mapper/SysBaseParamMapper.java
+31
-0
SysBaseParam.java
src/main/java/com/hwstudio/antaile/mbg/po/SysBaseParam.java
+148
-0
SysBaseParamExample.java
...java/com/hwstudio/antaile/mbg/po/SysBaseParamExample.java
+0
-0
SysBaseParamDao.java
...wstudio/antaile/operation/system/dao/SysBaseParamDao.java
+9
-0
ISysBaseParamService.java
...ntaile/operation/system/service/ISysBaseParamService.java
+19
-0
SysBaseParamServiceImpl.java
...peration/system/service/impl/SysBaseParamServiceImpl.java
+42
-0
application.yml
src/main/resources/application.yml
+7
-30
SysBaseParamMapper.xml
src/main/resources/mapping/mbg/SysBaseParamMapper.xml
+0
-0
SysBaseParamDao2.xml
src/main/resources/mapping/operation/SysBaseParamDao2.xml
+6
-0
SysBaseParamDao.xml
...in/resources/mapping/operation/system/SysBaseParamDao.xml
+9
-0
No files found.
pom.xml
View file @
f7fcb70f
...
...
@@ -221,6 +221,11 @@
<artifactId>
swagger-bootstrap-ui
</artifactId>
<version>
1.9.6
</version>
</dependency>
<!--代码生成器@entity等注解标识-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
</dependency>
</dependencies>
<repositories>
...
...
@@ -241,6 +246,13 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<configuration>
<skipTests>
true
</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -270,10 +282,17 @@
<configuration>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
<
!--<encoding>${project.build.sourceEncoding}</encoding>--
>
<
encoding>
${project.build.sourceEncoding}
</encoding
>
</configuration>
</plugin>
<!--<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>-->
<!-- mybatis generator 自动生成代码插件 -->
<plugin>
<groupId>
org.mybatis.generator
</groupId>
...
...
src/main/java/com/hwstudio/antaile/AntaileApplication.java
View file @
f7fcb70f
...
...
@@ -15,7 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableCaching
//springBoot自带的定时任务注解
@EnableScheduling
@MapperScan
(
"com.hwstudio.antaile.mapper"
)
@MapperScan
(
value
=
{
"com.hwstudio.antaile.mapper"
,
"com.hwstudio.antaile.mbg.mapper"
,
"com.hwstudio.antaile.operation.*.dao"
}
)
@EnableAutoConfiguration
(
exclude
={
DataSourceAutoConfiguration
.
class
})
public
class
AntaileApplication
extends
SpringBootServletInitializer
{
...
...
src/main/java/com/hwstudio/antaile/config/RedisConfig.java
View file @
f7fcb70f
...
...
@@ -13,11 +13,9 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.data.redis.cache.RedisCacheManager
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.StringRedisSerializer
;
import
java.lang.reflect.Method
;
/**
...
...
@@ -42,39 +40,43 @@ public class RedisConfig extends CachingConfigurerSupport {
/**
* 生成key的策略
*
* @return
*/
public
KeyGenerator
keyGenerator
(){
public
KeyGenerator
keyGenerator
()
{
return
new
KeyGenerator
()
{
@Override
public
Object
generate
(
Object
target
,
Method
method
,
Object
...
params
){
public
Object
generate
(
Object
target
,
Method
method
,
Object
...
params
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
target
.
getClass
().
getName
());
sb
.
append
(
method
.
getName
());
for
(
Object
obj
:
params
){
for
(
Object
obj
:
params
)
{
sb
.
append
(
obj
.
toString
());
}
return
sb
.
toString
();
}
};
}
/**
* 缓存管理器
*
* @param connectionFactory
* @return
*/
@Bean
public
CacheManager
cacheManager
(
RedisConnectionFactory
connectionFactory
){
public
CacheManager
cacheManager
(
RedisConnectionFactory
connectionFactory
)
{
RedisCacheManager
cacheManager
=
RedisCacheManager
.
create
(
connectionFactory
);
return
cacheManager
;
}
/**
* RedisTemplate配置
*
* @param factory
* @return
*/
public
RedisTemplate
<
String
,
Object
>
redisTemplate
(
RedisConnectionFactory
factory
)
{
public
RedisTemplate
<
String
,
Object
>
redisTemplate
(
RedisConnectionFactory
factory
)
{
RedisTemplate
<
String
,
Object
>
template
=
new
RedisTemplate
<>();
// 配置连接工厂
template
.
setConnectionFactory
(
factory
);
...
...
src/main/java/com/hwstudio/antaile/controller/SysAreaController.java
→
src/main/java/com/hwstudio/antaile/controller/
sys/
SysAreaController.java
View file @
f7fcb70f
package
com
.
hwstudio
.
antaile
.
controller
;
package
com
.
hwstudio
.
antaile
.
controller
.
sys
;
import
com.hwstudio.antaile.dto.CountryMobilePrefixListDto
;
import
com.hwstudio.antaile.dto.SysBaijiaxingDetailsDto
;
import
com.hwstudio.antaile.dto.SysBaijiaxingListDto
;
import
com.hwstudio.antaile.service.CountryMobilePrefixService
;
import
com.hwstudio.antaile.service.SysAreaService
;
import
com.hwstudio.antaile.service.SysBaijiaxingService
;
import
com.hwstudio.antaile.utils.JsonResult
;
import
com.hwstudio.antaile.vo.SysAreaVo
;
import
io.swagger.annotations.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Name:
...
...
src/main/java/com/hwstudio/antaile/controller/sys/SysBaseParamController.java
0 → 100644
View file @
f7fcb70f
package
com
.
hwstudio
.
antaile
.
controller
.
sys
;
import
com.hwstudio.antaile.operation.system.service.ISysBaseParamService
;
import
com.hwstudio.antaile.utils.JsonResult
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
/**
* @Author xh
* @Date 2020/12/2
* description:
*/
@Controller
@Api
(
tags
=
"系统基础参数相关接口"
,
description
=
"系统基础控制器"
)
@RequestMapping
(
"/sysBaseParam"
)
public
class
SysBaseParamController
{
@Autowired
private
ISysBaseParamService
sysBaseParamService
;
@ApiOperation
(
"根据参数编码查询一条系统参数信息"
)
@RequestMapping
(
value
=
"/getOneParamByParamCode"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
JsonResult
getOneParamByParamCode
(
@ApiParam
(
value
=
"系统参数编码"
,
required
=
true
)
@RequestParam
(
value
=
"paramCode"
,
required
=
true
)
String
paramCode
)
{
return
JsonResult
.
success
(
"查询成功"
,
this
.
sysBaseParamService
.
getOneParamByParamCode
(
paramCode
));
}
}
src/main/java/com/hwstudio/antaile/controller/SysController.java
→
src/main/java/com/hwstudio/antaile/controller/
sys/
SysController.java
View file @
f7fcb70f
package
com
.
hwstudio
.
antaile
.
controller
;
package
com
.
hwstudio
.
antaile
.
controller
.
sys
;
import
com.hwstudio.antaile.dto.CountryMobilePrefixListDto
;
import
com.hwstudio.antaile.dto.SysBaijiaxingDetailsDto
;
...
...
src/main/java/com/hwstudio/antaile/mbg/mapper/SysBaseParamMapper.java
0 → 100644
View file @
f7fcb70f
package
com
.
hwstudio
.
antaile
.
mbg
.
mapper
;
import
com.hwstudio.antaile.mbg.po.SysBaseParam
;
import
com.hwstudio.antaile.mbg.po.SysBaseParamExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
public
interface
SysBaseParamMapper
{
long
countByExample
(
SysBaseParamExample
example
);
int
deleteByExample
(
SysBaseParamExample
example
);
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
SysBaseParam
record
);
int
insertSelective
(
SysBaseParam
record
);
List
<
SysBaseParam
>
selectByExample
(
SysBaseParamExample
example
);
SysBaseParam
selectByPrimaryKey
(
Long
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
SysBaseParam
record
,
@Param
(
"example"
)
SysBaseParamExample
example
);
int
updateByExample
(
@Param
(
"record"
)
SysBaseParam
record
,
@Param
(
"example"
)
SysBaseParamExample
example
);
int
updateByPrimaryKeySelective
(
SysBaseParam
record
);
int
updateByPrimaryKey
(
SysBaseParam
record
);
}
\ No newline at end of file
src/main/java/com/hwstudio/antaile/mbg/po/SysBaseParam.java
0 → 100644
View file @
f7fcb70f
package
com
.
hwstudio
.
antaile
.
mbg
.
po
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
org.springframework.format.annotation.DateTimeFormat
;
@Entity
public
class
SysBaseParam
implements
Serializable
{
@ApiModelProperty
(
value
=
"主键"
)
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@ApiModelProperty
(
value
=
"参数名"
)
private
String
paramName
;
@ApiModelProperty
(
value
=
"参数编码"
)
private
String
paramCode
;
@ApiModelProperty
(
value
=
"参数值"
)
private
String
paramValue
;
@ApiModelProperty
(
value
=
"参数类型 1|字符串,2|integer整数类型,3|bool类型,4|char类型,5|double精度类型,6|日期类型,7|对象类型,8|数组类型,9|附件类型 10|sql 11|json"
)
private
Integer
paramType
;
@ApiModelProperty
(
value
=
"说明"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"状态"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"删除标志 0|正常|1删除"
)
private
Integer
isDelete
;
@ApiModelProperty
(
value
=
"创建时间"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"更新时间"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
private
static
final
long
serialVersionUID
=
1L
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getParamName
()
{
return
paramName
;
}
public
void
setParamName
(
String
paramName
)
{
this
.
paramName
=
paramName
;
}
public
String
getParamCode
()
{
return
paramCode
;
}
public
void
setParamCode
(
String
paramCode
)
{
this
.
paramCode
=
paramCode
;
}
public
String
getParamValue
()
{
return
paramValue
;
}
public
void
setParamValue
(
String
paramValue
)
{
this
.
paramValue
=
paramValue
;
}
public
Integer
getParamType
()
{
return
paramType
;
}
public
void
setParamType
(
Integer
paramType
)
{
this
.
paramType
=
paramType
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getIsDelete
()
{
return
isDelete
;
}
public
void
setIsDelete
(
Integer
isDelete
)
{
this
.
isDelete
=
isDelete
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", paramName="
).
append
(
paramName
);
sb
.
append
(
", paramCode="
).
append
(
paramCode
);
sb
.
append
(
", paramValue="
).
append
(
paramValue
);
sb
.
append
(
", paramType="
).
append
(
paramType
);
sb
.
append
(
", remark="
).
append
(
remark
);
sb
.
append
(
", status="
).
append
(
status
);
sb
.
append
(
", isDelete="
).
append
(
isDelete
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
}
\ No newline at end of file
src/main/java/com/hwstudio/antaile/mbg/po/SysBaseParamExample.java
0 → 100644
View file @
f7fcb70f
This diff is collapsed.
Click to expand it.
src/main/java/com/hwstudio/antaile/operation/system/dao/SysBaseParamDao.java
0 → 100644
View file @
f7fcb70f
package
com
.
hwstudio
.
antaile
.
operation
.
system
.
dao
;
/**
* @Author xh
* @Date 2021/4/16
* description:
*/
public
interface
SysBaseParamDao
{
}
src/main/java/com/hwstudio/antaile/operation/system/service/ISysBaseParamService.java
0 → 100644
View file @
f7fcb70f
package
com
.
hwstudio
.
antaile
.
operation
.
system
.
service
;
import
com.hwstudio.antaile.mbg.po.SysBaseParam
;
/**
* @Author xh
* @Date 2021/4/16
* description:
*/
public
interface
ISysBaseParamService
{
/**
* 根据参数编码 查询一个系统参数
*
* @param paramCode
* @return
*/
SysBaseParam
getOneParamByParamCode
(
String
paramCode
);
}
src/main/java/com/hwstudio/antaile/operation/system/service/impl/SysBaseParamServiceImpl.java
0 → 100644
View file @
f7fcb70f
package
com
.
hwstudio
.
antaile
.
operation
.
system
.
service
.
impl
;
import
com.hwstudio.antaile.mbg.mapper.SysBaseParamMapper
;
import
com.hwstudio.antaile.mbg.po.SysBaseParam
;
import
com.hwstudio.antaile.mbg.po.SysBaseParamExample
;
import
com.hwstudio.antaile.operation.system.service.ISysBaseParamService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @Author xh
* @Date 2021/4/16
* description:
*/
@Service
public
class
SysBaseParamServiceImpl
implements
ISysBaseParamService
{
@Resource
private
SysBaseParamMapper
sysBaseParamMapper
;
/**
* 根据参数编码 查询一个系统参数
*
* @param paramCode
* @return
*/
@Override
public
SysBaseParam
getOneParamByParamCode
(
String
paramCode
){
SysBaseParamExample
example
=
new
SysBaseParamExample
();
SysBaseParamExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andParamCodeEqualTo
(
paramCode
);
List
<
SysBaseParam
>
sysBaseParamList
=
this
.
sysBaseParamMapper
.
selectByExample
(
example
);
if
(
sysBaseParamList
==
null
||
sysBaseParamList
.
size
()
<=
0
){
return
null
;
}
return
sysBaseParamList
.
get
(
0
);
}
}
src/main/resources/application.yml
View file @
f7fcb70f
spring
:
mvc
:
view
:
...
...
@@ -15,10 +13,9 @@ spring:
url
:
jdbc:mysql://yzcdb001w.mysql.rds.aliyuncs.com:3306/atlapp?characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username
:
usr_atlapp
password
:
Atl@120726
#url: jdbc:mysql://47.98.216.76:3306/atl-app?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
#username: root
#password: Atl@ljc1653819
#url: jdbc:mysql://47.111.181.202:3306/antaile?characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
#url: jdbc:mysql://yzcdb001w.mysql.rds.aliyuncs.com:3306/atlapp?characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
#password: 6just@2019
type
:
com.alibaba.druid.pool.DruidDataSource
#连接池配置,因为springboot默认是开启了连接池的,它有默认配置,这一段可以忽略
#初始化大小,最小,最大
...
...
@@ -41,24 +38,6 @@ spring:
#max-pool-prepared-statement-per-connection-size: 20
#配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
#filters: stat,wall,log4j
# #thymeleaf配置
# thymeleaf:
# cache: false
# #默认配置,有其他需求在进行更改
# prefix: WEB-INF/view
# suffix: .jsp
# mode: HTML5
# encoding: UTF-8
# servlet:
# content-type: text/html
# chain:
# strategy:
# content:
# enabled: true
# paths: /**
#设置热部署
devtools
:
restart
:
...
...
@@ -66,20 +45,18 @@ spring:
enabled
:
true
#重启范围
additional-paths
:
src/main/java
#redis
redis
:
# Redis数据库索引(默认为0)
database
:
0
# Redis服务器地址
host
:
47.98.96.174
#host: 47.98.96.174
host
:
127.0.0.1
# Redis服务器连接端口
port
:
6379
# Redis服务器连接密码(默认为空)
password
:
"
root123!!"
#password:
atl@redis_120726
#
password: "root123!!"
#password:
""
jedis
:
pool
:
# 连接池最大连接数(使用负值表示没有限制)
...
...
@@ -98,7 +75,7 @@ server:
#配置mybatis
mybatis
:
mapper-locations
:
classpath:mapping/*.xml
mapper-locations
:
classpath:mapping/*
*/*
.xml
#全局的映射,不用在xml文件写实体类的全路径
type-aliases-package
:
com.hwstudio.antaile
#开启驼峰映射
...
...
src/main/resources/mapping/mbg/SysBaseParamMapper.xml
0 → 100644
View file @
f7fcb70f
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/operation/SysBaseParamDao2.xml
0 → 100644
View file @
f7fcb70f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.hwstudio.antaile.operation.system.dao.SysBaseParamDao"
>
</mapper>
\ No newline at end of file
src/main/resources/mapping/operation/system/SysBaseParamDao.xml
0 → 100644
View file @
f7fcb70f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.hwstudio.antaile.operation.system.dao.SysBaseParamDao"
>
<resultMap
id=
"baseResultMap"
type=
"com.hwstudio.antaile.mbg.po.SysBaseParam"
extends=
"com.hwstudio.antaile.mbg.mapper.SysBaseParamMapper.BaseResultMap"
>
</resultMap>
</mapper>
\ No newline at end of file
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