Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-web
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
cloud-web
Commits
15249948
Commit
15249948
authored
Jan 03, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我要留言
parent
6283efc6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
108 additions
and
0 deletions
+108
-0
cloud-web-manage/src/main/java/com/yizhi/application/portal/controller/LeaveWordManageController.java
+108
-0
No files found.
cloud-web-manage/src/main/java/com/yizhi/application/portal/controller/LeaveWordManageController.java
0 → 100644
View file @
15249948
package
com
.
yizhi
.
application
.
portal
.
controller
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.training.application.feign.LeaveWordClient
;
import
com.yizhi.training.application.vo.domain.LeaveWordParamVo
;
import
com.yizhi.training.application.vo.domain.LeaveWordVo
;
import
com.yizhi.util.application.domain.Response
;
import
com.yizhi.util.application.enums.i18n.Constants
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* com.yizhi.application.portal.controller
*
* @author yanglang
* @create 2025-01-03 13:42:52
*/
@Api
(
tags
=
"管理端-留言管理"
,
description
=
"留言管理"
)
@RestController
@RequestMapping
(
"/manage/leaveWord"
)
public
class
LeaveWordManageController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
LeaveWordManageController
.
class
);
@Autowired
private
LeaveWordClient
leaveWordClient
;
@PostMapping
(
"/page"
)
@ApiOperation
(
value
=
"分页查询"
,
notes
=
"分页查询"
)
public
Response
<
Page
<
LeaveWordVo
>>
page
(
@ApiParam
(
name
=
"leaveWordParamVo"
,
value
=
""
)
@RequestBody
LeaveWordParamVo
leaveWordParamVo
){
try
{
Page
<
LeaveWordVo
>
page
=
leaveWordClient
.
page
(
leaveWordParamVo
);
return
Response
.
ok
(
page
);
}
catch
(
Exception
e
){
logger
.
error
(
"分页查询失败"
);
return
Response
.
fail
(
Constants
.
MSG_BIZ_FAIL
);
}
}
@PostMapping
(
"/pageByMy"
)
@ApiOperation
(
value
=
"我的分页查询"
,
notes
=
"我的分页查询"
)
public
Response
<
Page
<
LeaveWordVo
>>
pageByMy
(
@ApiParam
(
name
=
"leaveWordParamVo"
,
value
=
""
)
@RequestBody
LeaveWordParamVo
leaveWordParamVo
){
try
{
RequestContext
context
=
ContextHolder
.
get
();
leaveWordParamVo
.
setCreateById
(
context
.
getAccountId
());
Page
<
LeaveWordVo
>
page
=
leaveWordClient
.
page
(
leaveWordParamVo
);
return
Response
.
ok
(
page
);
}
catch
(
Exception
e
){
logger
.
error
(
"分页查询失败"
);
return
Response
.
fail
(
Constants
.
MSG_BIZ_FAIL
);
}
}
@PostMapping
(
"/save"
)
@ApiOperation
(
value
=
"保存"
,
notes
=
"保存"
)
public
Response
save
(
@ApiParam
(
name
=
"leaveWordVo"
,
value
=
""
)
@RequestBody
LeaveWordVo
leaveWordVo
){
try
{
return
Response
.
ok
(
leaveWordClient
.
save
(
leaveWordVo
));
}
catch
(
Exception
e
){
logger
.
error
(
"保存失败"
);
return
Response
.
fail
(
Constants
.
MSG_BIZ_FAIL
);
}
}
@GetMapping
(
"/getById"
)
@ApiOperation
(
value
=
"查询"
,
notes
=
"查询"
)
public
Response
<
LeaveWordVo
>
getById
(
@ApiParam
(
name
=
"id"
,
value
=
""
)
@RequestParam
(
name
=
"id"
)
Long
id
){
try
{
return
Response
.
ok
(
leaveWordClient
.
getById
(
id
));
}
catch
(
Exception
e
){
logger
.
error
(
"查询失败"
);
return
Response
.
fail
(
Constants
.
MSG_BIZ_FAIL
);
}
}
@GetMapping
(
"/updateState"
)
@ApiOperation
(
value
=
"修改状态"
,
notes
=
"修改状态"
)
public
Response
updateState
(
@ApiParam
(
name
=
"id"
,
value
=
""
)
@RequestParam
(
name
=
"id"
)
Long
id
,
@ApiParam
(
name
=
"state"
,
value
=
""
)
@RequestParam
(
name
=
"state"
)
Integer
state
){
try
{
return
Response
.
ok
(
leaveWordClient
.
updateState
(
id
,
state
));
}
catch
(
Exception
e
){
logger
.
error
(
"修改状态失败"
);
return
Response
.
fail
(
Constants
.
MSG_BIZ_FAIL
);
}
}
@GetMapping
(
"/removeById"
)
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
public
Response
removeById
(
@ApiParam
(
name
=
"id"
,
value
=
""
)
@RequestParam
(
name
=
"id"
)
Long
id
){
try
{
return
Response
.
ok
(
leaveWordClient
.
removeById
(
id
));
}
catch
(
Exception
e
){
logger
.
error
(
"删除失败"
);
return
Response
.
fail
(
Constants
.
MSG_BIZ_FAIL
);
}
}
}
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