package com.yh.saas.plugin.configuration.basic.controller;

import java.util.List;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alipay.sofa.runtime.api.annotation.SofaReference;
import com.winsea.svc.base.base.entity.CrewDutyCompany;
import com.winsea.svc.base.base.service.ICrewDutyCompanyService;
import com.yh.saas.common.support.plugin.PluginFeature;

/**
 * <p>
 * 基础数据 船员职务 前端控制器
 * </p>
 *
 * @author ZhangMingYu
 * @since 2019-07-10
 */
@RestController
@PluginFeature(id = "ConfigBasicDataManagement", name = "系统基础数据管理")
@RequestMapping("/dutyBasic")
public class DutyBasicController {

	@SofaReference
	private ICrewDutyCompanyService dutyCompanyService;

	/**
	 * 船员职务查看
	 * 
	 * @param crewDutyCompany
	 * @return
	 */
	@GetMapping("/query/getQueryPage")
	public List<CrewDutyCompany> getList(CrewDutyCompany crewDutyCompany) {
		return dutyCompanyService.getList(crewDutyCompany);
	}

	/**
	 * 判断是否使用
	 * 
	 * @param crewDutyCompanies
	 */
	@PostMapping("/api/changeInfo")
	public void changeInfo(@RequestBody List<CrewDutyCompany> crewDutyCompanies) {
		dutyCompanyService.changeInfo(crewDutyCompanies);
	}

	/**
	 * 排序
	 * 
	 * @param crewDutyCompanies
	 */
	@PostMapping("/api/changeList")
	public void changeList(@RequestBody List<CrewDutyCompany> crewDutyCompanies) {
		dutyCompanyService.changeInfo(crewDutyCompanies);
	}

}
