package com.prolog.upcloud.base.wh.operate.resource;

import com.prolog.cs.basic.common.model.BaseCommonDict;
import com.prolog.cs.basic.common.model.SysRegistry;
import com.prolog.framework.common.message.RestMessage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author wujunjie
 */
@FeignClient(value = "${prolog.service.common}")
public interface CommonResource {

    enum typeCode {
        /**
         * 盘点方式
         */
        inv_stockcheck_h_checkgroup2,
        /**
         * 盘点类型
         */
        inv_stockcheck_type
    }

    @GetMapping("dict/basic/type-list")
    RestMessage<List<BaseCommonDict>> getDictBasicListByCodes(@RequestParam("typeCode") String typeCode, @RequestParam("dictCodes") String[] dictCodes);

    @PostMapping("/dict/listbytype")
    RestMessage<List<BaseCommonDict>> getListByDicttype(@RequestParam("dicttypeIds") String dicttypeIds, @RequestParam("dicttypeCodes") String dicttypeCodes);

    @GetMapping("/registry/get-code")
    RestMessage<SysRegistry> getParameterValueByCode(@RequestParam("regCode") String regCode, @RequestParam("enterpriseId") String enterpriseId);
}
