Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
ts-api-demo
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
wmvm
ts-api-demo
Commits
23b82378
Commit
23b82378
authored
Oct 28, 2024
by
ml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返佣时间周期配置
parent
c87db480
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
0 deletions
+80
-0
redis-val.ts
src/constant/redis-val.ts
+6
-0
rewardTimePeriod.control.ts
src/functional/mvc/control/rewardTimePeriod.control.ts
+66
-0
index.ts
src/functional/router/v1/index.ts
+5
-0
access-limit.ts
src/setting/access-limit.ts
+3
-0
No files found.
src/constant/redis-val.ts
View file @
23b82378
...
...
@@ -33,3 +33,9 @@ export const ADDRESS_INFO_REDIS_KEY_OBJ = "b029.addressInfo.service.get.obj";
export
const
APP_SPECIAL_MODEL_REDIS_KEY
=
"b029.app.sepecial.model.redis.key"
;
/**
* 返佣时间周期配置
*/
export
const
REWARD_TIME_PERIOD_REDIS_KEY
=
"bk_reward_time_period_config"
;
src/functional/mvc/control/rewardTimePeriod.control.ts
0 → 100644
View file @
23b82378
import
{
AppVersionPageVO
}
from
"../service/appVersion.service"
;
let
{
logger
,
Res3Utils
,
optionalUtils
:
Optional
,
apiAssertUtils
:
ApiAssert
,
datetimeUtils
}
=
require
(
'@madex/ex-js-public'
);
import
{
ErrorCode
}
from
"../../../constant/errorCode"
;
import
{
getCurrentUserId
}
from
"../../../utils/aclUserUtils"
;
import
{
APP_VERSION_KEY
,
REWARD_TIME_PERIOD_REDIS_KEY
}
from
"../../../constant/redis-val"
;
import
{
addOptLog
}
from
"../service/userOptLog.service"
;
let
{
authCommon
:
AuthCommon
,
redisUtilsCommon
:
RedisClient
,
}
=
require
(
'@madex/ex-js-common'
);
let
isIp
=
require
(
'is-ip'
);
export
interface
ParamVO
{
period_type
?:
number
;
// 1:半年;2:一年;3:2年;4:永久;
}
/**
* 时间周期设置
* @param req
* @param authConfigVO
*/
export
const
set
=
async
(
req
:
any
,
paramVO
:
ParamVO
)
=>
{
let
func_name
=
"rewardTimePeriod.control.set"
;
try
{
let
ip
=
isIp
(
req
.
ip
)
?
req
.
ip
:
'*.*.*.*'
;
let
currentUserId
=
await
getCurrentUserId
(
req
.
cookies
.
session_id
);
if
(
!
paramVO
.
period_type
||
!
[
1
,
2
,
3
,
4
].
includes
(
Number
(
paramVO
.
period_type
)))
{
throw
ErrorCode
.
PARAM_MISS
}
let
key
=
REWARD_TIME_PERIOD_REDIS_KEY
;
await
RedisClient
.
writeSync
(
key
,
paramVO
.
period_type
);
//管理后台操作日志
addOptLog
(
currentUserId
,
0
,
'返佣时间周期设置'
,
ip
,
`key:
${
key
}
,value:
${
paramVO
.
period_type
}
`
,
'返佣时间周期设置'
);
return
Res3Utils
.
result
(
'ok'
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
/**
* 时间周期配置查询
* @param req
* @param authConfigVO
*/
export
const
get
=
async
(
req
:
any
,
paramVO
:
ParamVO
)
=>
{
let
func_name
=
"rewardTimePeriod.control.get"
;
try
{
let
key
=
REWARD_TIME_PERIOD_REDIS_KEY
;
let
period_type
=
await
RedisClient
.
getSync
(
key
);
//管理后台操作日志
return
Res3Utils
.
result
({
period_type
:
period_type
?
period_type
:
""
});
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
src/functional/router/v1/index.ts
View file @
23b82378
...
...
@@ -47,6 +47,7 @@ import * as pairApplyCtrl from "../../mvc/control/pairApply.control";
import
*
as
cronApplyCtrl
from
"../../mvc/control/cronApply.control"
;
import
*
as
spotDataCtrl
from
"../../mvc/control/spotData.control"
;
import
*
as
exBusinessAreaCtrl
from
"../../mvc/control/exBusinessArea.control"
;
import
*
as
rewardTimePeriodCtrl
from
"../../mvc/control/rewardTimePeriod.control"
;
const
getFunc
=
{
'user/info'
:
userController
.
getUserInfo
,
...
...
@@ -283,6 +284,10 @@ const postFunc = {
'operate/other/business/area/router/update'
:
exBusinessAreaCtrl
.
routerUpdate
,
'operate/other/business/area/router/delete'
:
exBusinessAreaCtrl
.
routerDel
,
'operate/other/business/area/router/list'
:
exBusinessAreaCtrl
.
routerList
,
//技术部-其他管理-返佣时间配置
'tech/other/reward/time/period/set'
:
rewardTimePeriodCtrl
.
set
,
'tech/other/reward/time/period/get'
:
rewardTimePeriodCtrl
.
get
,
};
// TODO 这里先和 nodejs 的注册路由方式保持一样,后面在调整。
...
...
src/setting/access-limit.ts
View file @
23b82378
...
...
@@ -224,6 +224,9 @@ let cmdWhiteList = {
'operate/other/business/area/router/update'
:
1
,
'operate/other/business/area/router/delete'
:
1
,
'operate/other/business/area/router/list'
:
1
,
//技术部-其他管理-返佣时间配置
'tech/other/reward/time/period/set'
:
1
,
'tech/other/reward/time/period/get'
:
1
,
};
...
...
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