Authored by mali

发站内信接口

package com.yoho.ufo.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.ufo.service.model.InboxReqVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
/**
* Created by li.ma on 2019/3/19.
*/
@Service
public class InboxServiceImpl {
private static final Logger LOGGER = LoggerFactory.getLogger(InboxServiceImpl.class);
@Autowired
private ServiceCaller serviceCaller;
public void addInboxForPlatform(int uid, Integer type, Integer businessType, String params){
InboxReqVO reqVO = InboxReqVO.builder().businessType(businessType).params(params).type(type).uid(uid).build();
LOGGER.info("addInboxForPlatform.addInbox with reqVO is {}", reqVO);
JSONObject jsonObject = serviceCaller.asyncCall("ufo-gateway.addInboxForPlatform", reqVO, JSONObject.class).get();
LOGGER.info("addInboxForPlatform.addInbox call result is {}", jsonObject);
}
}
... ...
package com.yoho.ufo.service.model;
import com.alibaba.fastjson.JSONObject;
import lombok.experimental.Builder;
/**
* Created by shengguo.cai on 2018/9/12.
*/
@Builder
public class InboxReqVO{
private int uid;
private Integer type;
private Integer businessType;
private String params;
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
public Integer getBusinessType() {
return businessType;
}
public void setBusinessType(Integer businessType) {
this.businessType = businessType;
}
@Override
public String toString() {
return JSONObject.toJSONString(this);
}
}
\ No newline at end of file
... ...