Commit a7b70be6 authored by Hsinli's avatar Hsinli

add

parent 643b8ab7
Pipeline #19661 passed with stage
in 1 minute 5 seconds
'use strict';
const Controller = require('egg').Controller;
class PresellSearchHistoryController extends Controller {
/**
* 获取搜索历史
*/
async getSearchHistory() {
const { ctx } = this;
let ret = await ctx.service.cd.presellSearchHistory.getSearchHistory();
ctx.success(ret);
}
/**
* 清除搜索记录
*/
async cleanSearchHistory() {
const { ctx } = this;
let ret = await ctx.service.cd.presellSearchHistory.cleanSearchHistory();
ctx.success(ret);
}
}
module.exports = PresellSearchHistoryController;
......@@ -10,7 +10,12 @@ module.exports = app => {
//资讯详细内容
router.get('third', '/news/:id', 'cd.news.getNews');
//预售楼盘搜索历史
router.get('/presell/search_history', loginAuth, 'cd.presellSearchHistory.getSearchHistory');
//清除预售楼盘搜索历史
router.put('/presell/search_history', loginAuth, 'cd.presellSearchHistory.getSearchHistory');
};
\ No newline at end of file
......@@ -36,7 +36,7 @@ class PresellSearchHistoryService extends Service {
* 排序根据搜索时间逆序排列,距离当前时间近的排在前面,重复搜索的关键词取最近一次的搜索时间进行排序
* 如果没有搜索记录的就不显示搜索词
*/
async getList() {
async getSearchHistory() {
const { ctx } = this;
let ret = {
search_history: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment