编写http被动接收user
parent
0d3ae0c99d
commit
35082f74b8
@ -0,0 +1,22 @@
|
||||
package com.docus.server.collect.user.http;
|
||||
|
||||
import com.docus.core.util.json.JSON;
|
||||
import com.docus.infrastructure.web.api.CommonResult;
|
||||
import com.docus.server.ws.IHttpResult;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Component("httpUserResultImpl")
|
||||
public class HttpUserResultImpl implements IHttpResult {
|
||||
|
||||
@Override
|
||||
public String ok(Map<String, Object> params) {
|
||||
return JSON.toJSON(CommonResult.success("ok"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String fail(Map<String, Object> params) {
|
||||
return JSON.toJSON(CommonResult.failed("fail"));
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package com.docus.server.ws;
|
||||
|
||||
public interface IHttpResult extends IResult {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.docus.server.ws;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface IResult {
|
||||
|
||||
String ok(Map<String, Object> params);
|
||||
|
||||
String fail(Map<String, Object> params);
|
||||
|
||||
}
|
@ -1,11 +1,6 @@
|
||||
package com.docus.server.ws;
|
||||
|
||||
import java.util.Map;
|
||||
public interface IWsResult extends IResult {
|
||||
|
||||
public interface IWsResult {
|
||||
|
||||
String ok(Map<String, Object> params);
|
||||
|
||||
String fail(Map<String, Object> params);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue