package org.ta.pddserver.xxl;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.ta.pddserver.entity.GDTicketEntity;
import org.ta.pddserver.model.pddgd.response.GDTicketRepsonse;
import org.ta.pddserver.service.GDTicketService;
import org.ta.pddserver.service.impl.GDTicketImpl;
import org.ta.pddserver.utils.PddGDUtil;

import java.util.List;

@Service
@Slf4j
public class GDOperator {

    @Resource
    GDTicketImpl gdTicketImpl;

    public void getGdTickets() {
        List<GDTicketRepsonse> list = PddGDUtil.getTickets();
        for (GDTicketRepsonse gdTicketRepsonse : list) {
            GDTicketEntity  gdTicketEntity = gdTicketImpl.getByTicketId(gdTicketRepsonse.getTicket_id());
            if (gdTicketEntity == null) {
                // todo 保存
                // 主体、绑定两个表
            }
        }
    }
}
