Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mp_estate_server
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
mp_estate_backstage
mp_estate_server
Commits
d697fd57
Commit
d697fd57
authored
Sep 17, 2020
by
成旭东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
楼盘详情 动态 户型图 楼盘图片查询接口分开
parent
996bb819
Pipeline
#28262
passed with stage
in 7 minutes 18 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
22 deletions
+79
-22
list.ts
app/controller/mpEstate/list.ts
+27
-0
router.ts
app/router.ts
+3
-0
list.ts
app/service/mpEstate/list.ts
+46
-19
config.local.ts
config/config.local.ts
+3
-3
No files found.
app/controller/mpEstate/list.ts
View file @
d697fd57
...
...
@@ -246,6 +246,33 @@ export default class EstateListController extends Controller {
ctx
.
success
(
data
);
}
async
showTrends
()
{
const
{
ctx
,
service
,
serviceGroupName
,
serviceName
}
=
this
;
const
{
id
}
=
ctx
.
params
;
const
where
=
{
project_id
:
id
};
const
data
=
await
service
[
serviceGroupName
][
serviceName
].
findProjectTrends
(
where
);
ctx
.
success
(
data
);
}
async
showLayout
()
{
const
{
ctx
,
service
,
serviceGroupName
,
serviceName
}
=
this
;
const
{
id
}
=
ctx
.
params
;
const
where
=
{
project_id
:
id
};
const
data
=
await
service
[
serviceGroupName
][
serviceName
].
findProjectLayout
(
where
);
ctx
.
success
(
data
);
}
async
showImage
()
{
const
{
ctx
,
service
,
serviceGroupName
,
serviceName
}
=
this
;
const
{
id
}
=
ctx
.
params
;
const
where
=
{
project_id
:
id
};
const
data
=
await
service
[
serviceGroupName
][
serviceName
].
findProjectImage
(
where
);
ctx
.
success
(
data
);
}
async
update
()
{
const
{
ctx
,
service
,
updateRule
,
serviceGroupName
,
serviceName
}
=
this
;
const
{
id
}
=
ctx
.
params
;
...
...
app/router.ts
View file @
d697fd57
...
...
@@ -14,6 +14,9 @@ export default (app: Application) => {
// 新房房源管理
router
.
get
(
'/api/estate/list'
,
controller
.
mpEstate
.
list
.
list
);
router
.
get
(
'/api/estate/:id'
,
controller
.
mpEstate
.
list
.
show
);
router
.
get
(
'/api/estate/trends/:id'
,
controller
.
mpEstate
.
list
.
showTrends
);
router
.
get
(
'/api/estate/layout/:id'
,
controller
.
mpEstate
.
list
.
showLayout
);
router
.
get
(
'/api/estate/image/:id'
,
controller
.
mpEstate
.
list
.
showImage
);
router
.
put
(
'/api/estate/update/:id'
,
controller
.
mpEstate
.
list
.
update
);
router
.
get
(
'/api/estate/tag/:type'
,
controller
.
mpEstate
.
list
.
tag
);
...
...
app/service/mpEstate/list.ts
View file @
d697fd57
...
...
@@ -141,9 +141,6 @@ export default class EstateListService extends Service {
{
from
:
'businessInfo'
,
to
:
'businessInfo'
},
{
from
:
'officeInfo'
,
to
:
'officeInfo'
},
{
from
:
'projectTag'
,
to
:
'projectTag'
},
{
from
:
'projectTrends'
,
to
:
'projectTrends'
},
{
from
:
'houseLayout'
,
to
:
'houseLayout'
},
{
from
:
'houseImage'
,
to
:
'houseImage'
},
]);
format
=
newformatConfig
;
...
...
@@ -187,21 +184,6 @@ export default class EstateListService extends Service {
as
:
'projectTag'
,
required
:
false
,
where
:
{
valid
:
1
},
},
{
model
:
ctx
.
wafangModel
.
WafangProjectTrends
,
as
:
'projectTrends'
,
required
:
false
,
where
:
{
valid
:
1
},
},
{
model
:
ctx
.
wafangModel
.
WafangLayout
,
as
:
'houseLayout'
,
required
:
false
,
where
:
{
valid
:
1
},
},
{
model
:
ctx
.
wafangModel
.
WafangImage
,
as
:
'houseImage'
,
required
:
false
,
where
:
{
valid
:
1
},
}];
const
record
=
await
ctx
[
modelGroupName
][
modelName
].
findOne
({
...
...
@@ -212,6 +194,51 @@ export default class EstateListService extends Service {
return
ctx
.
service
.
output
.
toObject
(
record
,
format
);
}
async
findProjectTrends
(
where
=
{},
options
=
{},
raw
=
false
)
{
const
{
ctx
,
modelGroupName
,
formatConfig
}
=
this
;
let
format
:
any
;
if
(
!
raw
)
{
format
=
formatConfig
;
}
const
record
=
await
ctx
[
modelGroupName
].
WafangProjectTrends
.
findAll
({
where
:
{
valid
:
1
,
...
where
},
...
options
,
});
return
ctx
.
service
.
output
.
toArray
(
record
,
format
);
}
async
findProjectLayout
(
where
=
{},
options
=
{},
raw
=
false
)
{
const
{
ctx
,
modelGroupName
,
formatConfig
}
=
this
;
let
format
:
any
;
if
(
!
raw
)
{
format
=
formatConfig
;
}
const
record
=
await
ctx
[
modelGroupName
].
WafangLayout
.
findAll
({
where
:
{
valid
:
1
,
...
where
},
...
options
,
});
return
ctx
.
service
.
output
.
toArray
(
record
,
format
);
}
async
findProjectImage
(
where
=
{},
options
=
{},
raw
=
false
)
{
const
{
ctx
,
modelGroupName
,
formatConfig
}
=
this
;
let
format
:
any
;
if
(
!
raw
)
{
format
=
formatConfig
;
}
const
record
=
await
ctx
[
modelGroupName
].
WafangImage
.
findAll
({
where
:
{
valid
:
1
,
...
where
},
...
options
,
});
return
ctx
.
service
.
output
.
toArray
(
record
,
format
);
}
async
findTypeTag
(
where
=
{},
options
=
{},
raw
=
false
)
{
const
{
ctx
,
modelGroupName
,
formatConfig
}
=
this
;
...
...
@@ -235,7 +262,7 @@ export default class EstateListService extends Service {
},
});
const
orderArr
=
[
1
,
2
,
3
];
const
orderArr
=
[
1
,
2
,
3
];
if
(
params
.
order
&&
orderArr
.
includes
(
Number
(
params
.
order
)))
{
const
orderRecord
=
await
ctx
[
modelGroupName
][
modelName
].
findOne
({
...
...
config/config.local.ts
View file @
d697fd57
...
...
@@ -30,9 +30,9 @@ export default () => {
baseDir
:
'model/wafang'
,
dialect
:
'mysql'
,
host
:
'rm-wafang-rds-pubilc.mysql.rds.aliyuncs.com'
,
database
:
'wafang_
dev
'
,
username
:
'wafang
_test
'
,
password
:
'
ztQ4Y8piePY3521gx74Ii
'
,
database
:
'wafang_
pro
'
,
username
:
'wafang'
,
password
:
'
JE2gD1TA1T642
'
,
port
:
3306
,
}],
};
...
...
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