package cn.ey.biz.module.weaver.api.hrm;

import cn.ey.biz.module.weaver.common.Constants;
import cn.ey.biz.module.weaver.autoconfigure.FeignConfiguration;
import lombok.Data;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;

/**
 *  人员小卡片信息
 *
 */
@FeignClient(name= Constants.WEAVER_NAME, url="${weaver.service.url}", configuration = FeignConfiguration.class)
public interface GetHrmSimpleInfoService {

    @RequestMapping(method= RequestMethod.GET, value="/api/hrm/simpleinfo/getHrmSimpleInfo",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
            produces = MediaType.TEXT_PLAIN_VALUE)
    HrmSimpleInfoRequest getHrmSimpleInfo(@RequestParam("userid")String userid);

    @Data
    class HrmSimpleInfoRequest{
        SimpleInfoRequest simpleInfo;
        List<FieldInfoRequest> fieldInfo;
        String status;
    }

    @Data
    class SimpleInfoRequest {
        String  departmentName;
        String  jobtitleName;
        String  locationName;
        String  workcode;
        String  jobtitle;
        String  sex;
        String  departmentid;
        String  ip;
        String  mobile;
        String  telephone;
        String  isOnline;
        String  subcompanyid1;
        String  managerid;
        String  managerName;
        String  lastname;
        String  locationid;
        String  statusName;
        String  id;
        String  subcompanyName;
        String  messageUrls;
        String  email;
        String status;
    }

    @Data
    class FieldInfoRequest {
        String fieldlabel;
        String fieldvalue;
        String linkurl;
    }

}
