UinPush.java 827 B

1234567891011121314151617181920212223242526
  1. package jnpf.message.util.unipush;
  2. import jnpf.config.ConfigValueUtil;
  3. import lombok.extern.slf4j.Slf4j;
  4. import org.apache.commons.lang3.StringUtils;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.stereotype.Component;
  7. import java.util.List;
  8. @Component
  9. @Slf4j
  10. public class UinPush {
  11. @Autowired
  12. private ConfigValueUtil configValueUtil;
  13. public void sendUniPush(List<String> cidList, String title, String content, String type, String text){
  14. if(cidList !=null && cidList.size()>0 ) {
  15. String cid = StringUtils.join(cidList,",");
  16. String url = configValueUtil.getAppPushUrl() + "?clientId=" + cid + "&title=" + title + "&content=" + content + "&text=" + text + "&create=true";
  17. cn.hutool.http.HttpUtil.get(url);
  18. }
  19. }
  20. }