package com.mortals.xhx.daemon.task;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.xhx.common.code.SendStatusEnum;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.common.utils.SendSmsTask;
import com.mortals.xhx.common.utils.SendTaskThreadPool;
import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity;
import com.mortals.xhx.module.alarm.model.AlarmSmsSendQuery;
import com.mortals.xhx.module.alarm.service.AlarmSmsSendService;
import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 同步用户
 */
@Slf4j
@Service("SyncUserTask")
public class SyncUserTaskImpl implements ITaskExcuteService {

    @Autowired
    private IUserFeign userFeign;


    @Override
    public void excuteTask(ITask task) throws AppException {

        return;
//        UserPdu userPdu = new UserPdu();
//        userPdu.setPage(1);
//        userPdu.setSize(-1);
//        String resp = userFeign.findAllUser(userPdu);
//        log.info("resp:{}",resp);
//        JSONObject jsonObject = JSONObject.parseObject(resp);
//        if (jsonObject.getInteger("code") == 1) {
//            List<UserPdu> userList = jsonObject.getJSONObject("data").getObject("data", new TypeReference<List<UserPdu>>() {
//            });
//
//            log.info("userList:{}", JSON.toJSONString(userList));
//
//        }

    }


    @Override
    public void stopTask(ITask task) throws AppException {

    }


}
