Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
蒋勇
zhichan
Commits
c8e64b2e
Commit
c8e64b2e
authored
Nov 22, 2019
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加删除接口
parent
a00fc492
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
10 deletions
+84
-10
laowubao/app/base/api/impl/operator/laoActionApi.js
+34
-0
laowubao/app/base/service/impl/operator/labourSve.js
+20
-1
laowubao/app/base/service/impl/operator/recruitSve.js
+20
-4
laowubao/app/config/localsettings.js
+10
-5
laowubao/package-lock.json
+0
-0
No files found.
laowubao/app/base/api/impl/operator/laoActionApi.js
View file @
c8e64b2e
...
...
@@ -30,6 +30,40 @@ class LaoActionApi extends APIBase {
return
randomNum
;
}
/**
* 删除招聘或者是供招的信息
* @param {*} obj
* @userId 用户信息
* @id 删除记录的id
* @type 删除类型
*/
async
RemRecOrLob
(
obj
){
if
(
!
obj
.
type
){
return
system
.
getResult
(
-
1
,
`参数错误 删除类型不能为空`
);
}
if
(
!
obj
.
userId
){
return
system
.
getResult
(
-
1
,
`参数错误 用户ID不能为空`
);
}
if
(
!
obj
.
id
){
return
system
.
getResult
(
-
1
,
`参数错误 删除记录ID不能为空`
);
}
let
params
=
{};
params
.
type
=
this
.
trim
(
obj
.
type
);
params
.
userId
=
Number
(
this
.
trim
(
obj
.
userId
));
params
.
id
=
Number
(
this
.
trim
(
obj
.
id
));
try
{
if
(
params
.
type
==
"10"
){
//招聘的
return
await
this
.
recruitSve
.
RemRecOrLob
(
params
);
}
else
if
(
params
.
type
==
"20"
){
//供人的
return
await
this
.
labourSve
.
RemRecOrLob
(
params
);
}
else
{
return
system
.
getResult
(
-
1
,
`参数错误 删除类型不存在`
);
}
}
catch
(
error
)
{
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
SendSms
(
obj
)
{
//用户登录,返回用户信息
if
(
!
obj
.
phone_no
)
{
return
system
.
getResult
(
null
,
"电话号码不能为空"
);
...
...
laowubao/app/base/service/impl/operator/labourSve.js
View file @
c8e64b2e
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
/**
* 供人信息
*/
class
LabourService
extends
ServiceBase
{
constructor
()
{
super
(
"operator"
,
ServiceBase
.
getDaoName
(
LabourService
));
...
...
@@ -144,7 +147,23 @@ class LabourService extends ServiceBase {
return
0
;
}
}
/**
* 删除用户下制定 招聘或这是供招信息记录
* @param {*} params
*/
async
RemRecOrLob
(
params
){
try
{
let
res
=
await
this
.
dao
.
model
.
destroy
({
where
:{
id
:
params
.
id
,
user_id
:
params
.
userId
}
});
return
system
.
getResult
(
res
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
LabourService
;
...
...
laowubao/app/base/service/impl/operator/recruitSve.js
View file @
c8e64b2e
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
/**
* 招聘信息
*/
class
RecruitService
extends
ServiceBase
{
constructor
()
{
super
(
"operator"
,
ServiceBase
.
getDaoName
(
RecruitService
));
...
...
@@ -227,10 +230,23 @@ class RecruitService extends ServiceBase {
return
0
;
}
}
/**
* 删除用户下制定 招聘或这是供招信息记录
* @param {*} params
*/
async
RemRecOrLob
(
params
){
try
{
let
res
=
await
this
.
dao
.
model
.
destroy
({
where
:{
id
:
params
.
id
,
user_id
:
params
.
userId
}
});
return
system
.
getResult
(
res
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
RecruitService
;
...
...
laowubao/app/config/localsettings.js
View file @
c8e64b2e
...
...
@@ -7,11 +7,16 @@ var settings={
},
database
:{
dbname
:
"laowubao"
,
user
:
"write"
,
password
:
"write"
,
config
:
{
host
:
'43.247.184.35'
,
port
:
8899
,
user
:
"write"
,
password
:
"write"
,
config
:
{
host
:
'192.168.18.237'
,
// dbname : "laowubao",
// user: "write",
// password: "write",
// config: {
// host: '43.247.184.35',
port
:
3306
,
dialect
:
'mysql'
,
operatorsAliases
:
false
,
pool
:
{
...
...
laowubao/package-lock.json
View file @
c8e64b2e
This diff is collapsed.
Click to expand it.
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