local this = {}

function this:rsp_worldMapMarkListSync(data)
  if not table.isEmpty(data) then
    self:rsp_syncWorldMapMarkList(data)
  end
end

function this:req_worldMapMarkAdd(data, callback)
  L_Net:sendMessage(MsgGenCode.CSProtoWorldMapMarkAdd, data, function(rspData, errorCode)
    if errorCode == L_Const.errorCode.ErrCodeSucc then
      self:rsp_syncWorldMapMarkAdd(rspData)
      if callback then
        callback(rspData)
      end
    elseif errorCode == 12019 then
      L_FlyMsgManager:showNormalMsg(L_WordsTpl:getValue("notice_mapAction"))
    end
  end)
end

function this:req_worldMapMarkDel(curGuid, mapId, callback)
  L_Net:sendMessage(MsgGenCode.CSProtoWorldMapMarkDel, {u32 = curGuid}, function()
    self:rsp_syncWorldMapMarkDel(curGuid, mapId)
    if callback then
      callback()
    end
  end)
end

function this:req_worldMapMarkTracePointSet(guid, callback)
  local areaId = L_AreaStore:getMapAreaId()
  local info = self:getMarkBymapInfo(areaId, guid)
  if info and info.markId == L_Const.mapNavPointId then
    L_SceneGuideManager:removeDeepGuides()
  end
  self:rsp_syncWorldMapMarkTracePointSet(guid)
end

function this:req_worldMapMarkTraceDel(guid, callback)
  self:rsp_syncWorldMapMarkTraceDel(guid)
end

return this
