package com.mortals.xhx.module.job.web;

import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.JobTypeEnum;
import com.mortals.xhx.module.job.model.JobEntity;
import com.mortals.xhx.module.job.service.JobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 职位信息
 *
 * @author zxfei
 * @date 2023-04-07
 */
@RestController
@RequestMapping("job")
public class JobController extends BaseCRUDJsonBodyMappingController<JobService, JobEntity, Long> {

    @Autowired
    private ParamService paramService;


    public JobController() {
        super.setModuleDesc("职位信息");
    }

    @Override
    protected void init(Map<String, Object> model, Context context) {
        this.addDict(model, "type", JobTypeEnum.getEnumMap());
        super.init(model, context);
    }

    @Override
    protected void doListBefore(JobEntity query, Map<String, Object> model, Context context) throws AppException {
        query.setSize(-1);
        query.setType(1);
        super.doListBefore(query, model, context);
    }
}
