All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nebula.boxes.mvc.www.WwwCompanyController Maven / Gradle / Ivy

The newest version!
package com.nebula.boxes.mvc.www;

import com.nebula.boxes.iface.model.query.FirmQuery;
import com.nebula.boxes.iface.model.query.RecruitQuery;
import com.nebula.boxes.iface.model.view.FirmView;
import com.nebula.boxes.iface.model.view.RecruitView;
import com.nebula.boxes.iface.server.FirmIFace;
import com.nebula.boxes.iface.server.RecruitIFace;
import com.spring.boxes.dollar.enums.EnableEnum;
import com.spring.boxes.dollar.support.ApiResult;
import com.spring.boxes.dollar.support.Pagination;
import com.spring.boxes.dollar.term.ScopeKey;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "企业服务(Api)")
@Slf4j
@RestController
@RequestMapping("/api/www/hunt/")
public class WwwCompanyController {

    @Autowired
    private FirmIFace firmIFace;

    @Autowired
    private RecruitIFace recruitIFace;

    @ApiOperation("企业详情")
    @GetMapping("/company/queryById")
    public ApiResult queryCompanyById(@RequestParam(name = "id") long id) {
        long appId = ScopeKey.getAppId();
        long userId = ScopeKey.getUserId();
        FirmView one = firmIFace.queryFullView(appId, id, userId);
        return ApiResult.success(one);
    }

    @ApiOperation("推荐企业")
    @GetMapping("/company/querySuggest")
    public ApiResult querySuggestCompany(@ModelAttribute FirmQuery query,
                                            @RequestParam(name = "page", required = false, defaultValue = "1") int page,
                                            @RequestParam(name = "size", required = false, defaultValue = "15") int size) {
        long appId = ScopeKey.getAppId();
        long userId = ScopeKey.getUserId();
        Pagination pagination = firmIFace.queryMiniView(appId, userId, query, page, size);
        return ApiResult.success(pagination);
    }

    @ApiOperation("相似企业")
    @GetMapping("/company/querySimilar")
    public ApiResult querySimilarCompany(@ModelAttribute FirmQuery query,
                                            @RequestParam(name = "page", required = false, defaultValue = "1") int page,
                                            @RequestParam(name = "size", required = false, defaultValue = "15") int size) {
        long appId = ScopeKey.getAppId();
        long userId = ScopeKey.getUserId();
        Pagination pagination = firmIFace.queryMiniView(appId, userId, query, page, size);
        return ApiResult.success(pagination);
    }

    @ApiOperation("企业职位")
    @GetMapping("/company/queryRecruit")
    public ApiResult queryCompanyRecruitList(@RequestParam(name = "companyId") long companyId,
                                                @RequestParam(name = "page", required = false, defaultValue = "1") int page,
                                                @RequestParam(name = "size", required = false, defaultValue = "15") int size) {
        long appId = ScopeKey.getAppId();
        long userId = ScopeKey.getUserId();
        RecruitQuery query = new RecruitQuery();
        query.setFirmId(companyId);
        query.setEnabled(EnableEnum.ENABLED.getValue());
        Pagination pagination = recruitIFace.queryMiniView(appId, userId, query, page, size);
        return ApiResult.success(pagination);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy