Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
ec0f2a79
Commit
ec0f2a79
authored
Feb 23, 2025
by
wanghuazhou
Committed by
wux
Feb 27, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 货币汇率菜单与接口权限
parent
5987e3c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
20250222-currency-rate.sql
sql/v2.4/20250222-currency-rate.sql
+19
-0
CurrencyRateController.java
...controller/admin/currencyRate/CurrencyRateController.java
+7
-0
No files found.
sql/v2.4/20250222-currency-rate.sql
View file @
ec0f2a79
...
...
@@ -33,6 +33,8 @@ CREATE TABLE IF NOT EXISTS `ecw_currency_rate_log` (
PRIMARY
KEY
(
`id`
)
)
COMMENT
'币种汇率变更表'
;
BEGIN
;
INSERT
INTO
`system_dict_type`
(
`name`
,
`type`
,
`status`
,
`remark`
,
`creator`
,
`create_time`
,
`updater`
,
`update_time`
,
`deleted`
)
VALUES
(
'货币汇率状态'
,
'currency_rate_status'
,
0
,
NULL
,
'1'
,
'2022-05-23 23:29:07'
,
'1'
,
'2022-05-23 23:34:59'
,
b
'0'
);
...
...
@@ -41,3 +43,20 @@ INSERT INTO `system_dict_data`
VALUES
(
0
,
'已过期'
,
'1'
,
'currency_rate_status'
,
0
,
'warning'
,
''
,
NULL
,
'1'
,
'2022-11-18 00:18:34'
,
'1'
,
'2023-01-15 18:09:43'
,
b
'0'
,
'Expired'
),
(
1
,
'生效中'
,
'0'
,
'currency_rate_status'
,
0
,
'warning'
,
''
,
NULL
,
'1'
,
'2022-11-18 00:18:34'
,
'1'
,
'2023-01-15 18:09:43'
,
b
'0'
,
'Active'
);
SET
@
parent
=
1244
;
INSERT
INTO
`system_menu`
(
`name`
,
`permission`
,
`menu_type`
,
`sort`
,
`parent_id`
,
`path`
,
`icon`
,
`component`
,
`status`
,
`creator`
,
`create_time`
,
`updater`
,
`update_time`
,
`deleted`
,
`is_show_in_menu_bar`
,
`name_en`
,
`keepalive`
,
`redirect`
)
VALUES
(
'货币汇率'
,
'ecw:currency:rate:query'
,
2
,
3
,
@
parent
,
'currencyRate'
,
'money'
,
'ecw/currencyRate/index'
,
0
,
'115'
,
'2023-07-09 16:02:32'
,
'115'
,
'2023-07-12 22:33:09'
,
b
'0'
,
b
'1'
,
'currency rate'
,
b
'0'
,
NULL
);
SET
@
parent
=
LAST_INSERT_ID
();
INSERT
INTO
`system_menu`
(
`name`
,
`permission`
,
`menu_type`
,
`sort`
,
`parent_id`
,
`path`
,
`icon`
,
`component`
,
`status`
,
`creator`
,
`create_time`
,
`updater`
,
`update_time`
,
`deleted`
,
`is_show_in_menu_bar`
,
`name_en`
,
`keepalive`
,
`redirect`
)
VALUES
(
'货币汇率新增'
,
'ecw:currency:rate:create'
,
3
,
1
,
@
parent
,
''
,
''
,
''
,
0
,
'115'
,
'2023-07-09 16:02:32'
,
'115'
,
'2023-07-12 22:33:09'
,
b
'0'
,
b
'0'
,
'create'
,
b
'0'
,
NULL
),
(
'货币汇率编辑'
,
'ecw:currency:rate:update'
,
3
,
2
,
@
parent
,
''
,
''
,
''
,
0
,
'115'
,
'2023-07-09 16:02:32'
,
'115'
,
'2023-07-12 22:33:09'
,
b
'0'
,
b
'0'
,
'update'
,
b
'0'
,
NULL
),
(
'货币汇率删除'
,
'ecw:currency:rate:delete'
,
3
,
3
,
@
parent
,
''
,
''
,
''
,
0
,
'115'
,
'2023-07-09 16:02:32'
,
'115'
,
'2023-07-12 22:33:09'
,
b
'0'
,
b
'0'
,
'delete'
,
b
'0'
,
NULL
),
(
'货币汇率日志'
,
'ecw:currency:rate:history'
,
3
,
4
,
@
parent
,
''
,
''
,
''
,
0
,
'115'
,
'2023-07-09 16:02:32'
,
'115'
,
'2023-07-12 22:33:09'
,
b
'0'
,
b
'0'
,
'history'
,
b
'0'
,
NULL
);
COMMIT
;
\ No newline at end of file
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/controller/admin/currencyRate/CurrencyRateController.java
View file @
ec0f2a79
...
...
@@ -13,6 +13,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -37,6 +38,7 @@ public class CurrencyRateController {
@PostMapping
(
"/create"
)
@ApiOperation
(
"创建汇率信息"
)
@PreAuthorize
(
"@ss.hasPermission('ecw:currency:rate:create')"
)
public
CommonResult
<
Boolean
>
create
(
@Valid
@RequestBody
CurrencyRateCreateReqVO
req
)
{
service
.
create
(
req
);
return
success
(
true
);
...
...
@@ -44,6 +46,7 @@ public class CurrencyRateController {
@PutMapping
(
"/update"
)
@ApiOperation
(
"更新汇率信息"
)
@PreAuthorize
(
"@ss.hasPermission('ecw:currency:rate:update')"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
public
CommonResult
<
Boolean
>
update
(
@RequestParam
(
"id"
)
Long
id
,
@Valid
@RequestBody
CurrencyRateUpdateReqVO
req
)
{
service
.
update
(
id
,
req
);
...
...
@@ -52,6 +55,7 @@ public class CurrencyRateController {
@DeleteMapping
(
"/delete"
)
@ApiOperation
(
"删除汇率信息"
)
@PreAuthorize
(
"@ss.hasPermission('ecw:currency:rate:delete')"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
public
CommonResult
<
Boolean
>
delete
(
@RequestParam
(
"id"
)
Long
id
)
{
service
.
delete
(
id
);
...
...
@@ -60,18 +64,21 @@ public class CurrencyRateController {
@GetMapping
(
"/page"
)
@ApiOperation
(
"分页查询汇率信息"
)
@PreAuthorize
(
"@ss.hasPermission('ecw:currency:rate:query')"
)
public
CommonResult
<
PageResult
<
CurrencyRateDO
>>
page
(
@Valid
CurrencyRateQueryParamVO
param
)
{
return
success
(
service
.
query
(
param
));
}
@GetMapping
(
"/get"
)
@ApiOperation
(
"根据币种获取汇率信息"
)
@PreAuthorize
(
"@ss.hasPermission('ecw:currency:rate:query')"
)
public
CommonResult
<
CurrencyRateDO
>
get
(
@RequestParam
(
"sourceId"
)
Long
sourceId
,
@RequestParam
(
"targetId"
)
Long
targetId
)
{
return
success
(
service
.
find
(
sourceId
,
targetId
));
}
@GetMapping
(
"/logs"
)
@ApiOperation
(
"根据币种获取汇率根据货币符号"
)
@PreAuthorize
(
"@ss.hasPermission('ecw:currency:rate:history')"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
public
CommonResult
<
PageResult
<
CurrencyRateLogDO
>>
logs
(
@RequestParam
(
"id"
)
Long
id
,
PageParam
page
)
{
return
success
(
service
.
history
(
id
,
page
));
...
...
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