SearchController.java 1.1 KB
Newer Older
张辰's avatar
张辰 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
package com.tanpu.community.controller;

import com.tanpu.common.api.CommonResp;
import com.tanpu.common.auth.UserHolder;
import com.tanpu.common.auth.UserInfoHelper;
import com.tanpu.community.api.beans.qo.ThemeQo;
import com.tanpu.community.api.beans.qo.TopicDetailQo;
import com.tanpu.community.api.beans.req.search.ThemeFullSearchReq;
import com.tanpu.community.manager.ThemeManager;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@Slf4j
@RequestMapping(value = "/api/search")
public class SearchController {

    @Resource
    private UserHolder userHolder;

    @Autowired
    private ThemeManager themeManager;

    // 内容全文搜索
    public CommonResp<List<ThemeQo>> themeSearch(ThemeFullSearchReq req) {
        List<ThemeQo> list = themeManager.themeFullSearch(req.keyword, req.getPageNumber(), req.getPageSize(), userHolder.getUserId());
        return CommonResp.success(list);
    }

张辰's avatar
张辰 committed
35
}