package com.ruoyi.cms.controller.app;

import com.ruoyi.cms.service.ICompanyService;
import com.ruoyi.cms.service.IJobService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 岗位Controller
 * 
 * @author lishundong
 * @date 2024-09-03
 */
@RestController
@RequestMapping("/app/script")
@Api(tags = "移动端:脚本")
public class AppScriptController extends BaseController
{
    @Autowired
    private IJobService jobService;
    @Autowired
    private ICompanyService companyService;
    //更新经纬度
    @GetMapping("/updateLon")
    public void updateLon()
    {
        jobService.updateLon();
    }
    //导入数据
    @GetMapping("/import")
    public AjaxResult importData()
    {
        jobService.importData();
        return success();
    }
    //导入原始数据
    @GetMapping("/importRow")
    public AjaxResult importRow(@RequestParam String path)
    {
        jobService.importRow(path);
        return success();
    }
    // 导入500强
    @GetMapping("/importLabel500")
    public void importLabel()
    {
        companyService.importLabel();
    }
    // 随机导入3个公司到银行标签
    @GetMapping("/importLabelBank")
    public void importLabelBank()
    {
        companyService.importLabelBank();
    }
}
