Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
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
常超
map-parent
Commits
19495d4c
Commit
19495d4c
authored
Dec 26, 2022
by
宋珺琪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置管理模块
parent
6dfd6ccc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
177 additions
and
0 deletions
+177
-0
common/common_utils/src/main/java/com/founder/commonutils/model/newPublicEntity/ServiceConfig/ServiceConfigEntity.java
+43
-0
service/publicapi/src/main/java/com/founder/publicapi/controller/ServiceConfig/ServiceConfigController.java
+124
-0
service/publicapi/src/main/java/com/founder/publicapi/mapper/mysqlMapper/ServiceConfigMapper.java
+10
-0
No files found.
common/common_utils/src/main/java/com/founder/commonutils/model/newPublicEntity/ServiceConfig/ServiceConfigEntity.java
0 → 100644
View file @
19495d4c
package
com
.
founder
.
commonutils
.
model
.
newPublicEntity
.
ServiceConfig
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@TableName
(
"sk_service_config"
)
public
class
ServiceConfigEntity
{
@TableId
(
type
=
IdType
.
INPUT
)
@TableField
(
"id"
)
private
String
id
;
@TableField
(
"province"
)
private
String
province
;
@TableField
(
"map_address"
)
private
String
mapAddress
;
@TableField
(
"config_address"
)
private
String
configAddress
;
@TableField
(
"time"
)
private
String
time
;
@TableField
(
"is_deleted"
)
private
String
isDeleted
;
@TableField
(
exist
=
false
)
private
int
page
;
//当前第几页
@TableField
(
exist
=
false
)
private
int
limit
;
//每页多少行
}
service/publicapi/src/main/java/com/founder/publicapi/controller/ServiceConfig/ServiceConfigController.java
0 → 100644
View file @
19495d4c
package
com
.
founder
.
publicapi
.
controller
.
ServiceConfig
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.founder.commonutils.model.newPublicEntity.MapRestResult
;
import
com.founder.commonutils.model.newPublicEntity.ServiceConfig.ServiceConfigEntity
;
import
com.founder.commonutils.model.newPublicEntity.suggestionEntity.CommentEntity
;
import
com.founder.commonutils.util.KeyUtilNaotu
;
import
com.founder.publicapi.mapper.mysqlMapper.ServiceConfigMapper
;
import
com.founder.servicebase.logs.OperLog
;
import
com.founder.servicebase.logs.OperationType
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@RestController
@RequestMapping
(
"/config"
)
@Api
(
tags
=
"配置管理"
)
public
class
ServiceConfigController
{
@Autowired
ServiceConfigMapper
serviceConfigMapper
;
@PostMapping
(
"configAdd"
)
@ApiOperation
(
value
=
"配置管理新增"
)
@OperLog
(
message
=
"配置管理新增"
,
operation
=
OperationType
.
ADD
)
public
MapRestResult
configAdd
(
@RequestBody
ServiceConfigEntity
serviceConfigEntity
){
serviceConfigEntity
.
setId
(
KeyUtilNaotu
.
getJzKey
(
"PZ"
));
int
insert
=
serviceConfigMapper
.
insert
(
serviceConfigEntity
);
if
(
insert
>
0
){
return
new
MapRestResult
(
200
,
"新增成功"
,
null
);
}
else
{
return
new
MapRestResult
().
error
(
"保存失败"
);
}
}
/**
* 删
* @return
*/
@PostMapping
(
"configDelete"
)
@ApiOperation
(
value
=
"配置管理删除"
)
@OperLog
(
message
=
"配置管理删除"
,
operation
=
OperationType
.
DELETE
)
public
MapRestResult
configDelete
(
@RequestBody
ServiceConfigEntity
serviceConfigEntity
){
serviceConfigEntity
.
setIsDeleted
(
"1"
);
int
update
=
serviceConfigMapper
.
updateById
(
serviceConfigEntity
);
if
(
update
>
0
){
return
new
MapRestResult
(
200
,
"删除成功"
,
null
);
}
else
{
return
new
MapRestResult
(
200
,
"删除失败"
,
null
);
}
}
/**
* 改
* @return
*/
@PostMapping
(
"configUpdate"
)
@ApiOperation
(
value
=
"配置管理修改"
)
@OperLog
(
message
=
"配置管理修改"
,
operation
=
OperationType
.
UPDATE
)
public
MapRestResult
configUpdate
(
@RequestBody
ServiceConfigEntity
serviceConfigEntity
){
int
update
=
serviceConfigMapper
.
updateById
(
serviceConfigEntity
);
if
(
update
>
0
){
return
new
MapRestResult
(
200
,
"修改成功"
,
null
);
}
else
{
return
new
MapRestResult
(
200
,
"修改失败"
,
null
);
}
}
/**
* 查
* @return
*/
@PostMapping
(
"configQuery"
)
@ApiOperation
(
value
=
"配置管理列表"
)
@OperLog
(
message
=
"配置管理列表"
,
operation
=
OperationType
.
QUERY
)
public
MapRestResult
configQuery
(
@RequestBody
ServiceConfigEntity
serviceConfigEntity
){
QueryWrapper
wrapper
=
new
QueryWrapper
<>();
wrapper
.
like
(
"province"
,
serviceConfigEntity
.
getProvince
());
wrapper
.
eq
(
"is_deleted"
,
"0"
);
IPage
iPage
=
serviceConfigMapper
.
selectPage
(
new
Page
<>(
serviceConfigEntity
.
getPage
(),
serviceConfigEntity
.
getLimit
()),
wrapper
);
return
new
MapRestResult
(
200
,
"ok"
,
iPage
.
getTotal
(),
iPage
.
getRecords
());
}
/**
* 详情
* @return
*/
@PostMapping
(
"configDetails"
)
@ApiOperation
(
value
=
"详情"
)
@OperLog
(
message
=
"详情"
,
operation
=
OperationType
.
QUERY
)
public
MapRestResult
configDetails
(
@RequestBody
ServiceConfigEntity
serviceConfigEntity
){
ServiceConfigEntity
serviceConfigEntity1
=
serviceConfigMapper
.
selectById
(
serviceConfigEntity
.
getId
());
return
new
MapRestResult
(
200
,
"ok"
,
serviceConfigEntity1
);
}
/**
* 当前时间
* @return
*/
public
String
nowTime
(){
Date
date
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
return
formatter
.
format
(
date
);
}
}
service/publicapi/src/main/java/com/founder/publicapi/mapper/mysqlMapper/ServiceConfigMapper.java
0 → 100644
View file @
19495d4c
package
com
.
founder
.
publicapi
.
mapper
.
mysqlMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.founder.commonutils.model.newPublicEntity.ServiceConfig.ServiceConfigEntity
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
ServiceConfigMapper
extends
BaseMapper
<
ServiceConfigEntity
>
{
}
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