| | |
| | | import com.doumee.dao.business.dao.SmsEmailMapper; |
| | | import com.doumee.dao.business.model.Bookings; |
| | | import com.doumee.dao.business.model.SmsEmail; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | @Component |
| | | public class WxPlatNotice { |
| | | |
| | | public String getAccessToken(String appid,String secret) { |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appid+"&secret="+secret; |
| | | String response = HttpsUtil.get(url,false); |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | return json.getString("access_token"); |
| | | } |
| | | public void testSendNotice(List<String> openIds,String token){ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |