package com.malk.mcli.service.impl;

import com.malk.mcli.service.IH3yunWebService;
import org.springframework.stereotype.Component;

import javax.jws.WebService;
import javax.xml.ws.BindingType;
import javax.xml.ws.soap.SOAPBinding;

/**
 * @author shinka
 * @date 2021/03/26
 */
@WebService(serviceName = "H3yunWebService", // 与接口中指定的name一致
        targetNamespace = "http://service.example.com/h3yun", // 与接口中的命名空间一致,一般是接口的包名倒
        endpointInterface = "com.malk.mcli.service.IH3yunWebService" // 接口地址
)
@BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)
@Component
public class H3yunWebServiceImpl implements IH3yunWebService {

    @Override
    public String GetSchema(String schemaCode) {
        // 氚云在集成的时候会调用GetSchema方法，该方法返回值仅支持如下两种，业务逻辑请写在其它方法上
        return "{\"code\":\"\"}";
        // return "";
    }

    @Override
    public String GetSchemaList() {
        return "{\"schemaCode\":\"D001062ceshi2\"}";
    }

    @Override
    public String GetList(String userCode, String schemaCode, String filter) {
        return "{\"userCode\":\"" + userCode + "\",\"schemaCode\":\"" + schemaCode + "\",\"filter\":\"" + filter
                + "\"}";
    }

    @Override
    public String Invoke(String userCode, String schemaCode, String methodName, String param) {
        return "{\"userCode\":\"" + userCode + "\",\"schemaCode\":\"" + schemaCode + "\",\"methodName\":\"" + methodName
                + "\",\"param\":\"" + methodName + "\"}";
    }

}
