local AnnouncementMetaData = class("AnnouncementMetaData")

function AnnouncementMetaData:ctor(csAnnouncementResponeMetaData)
  self.title = csAnnouncementResponeMetaData.title
  self.content = csAnnouncementResponeMetaData.content
  self.language = csAnnouncementResponeMetaData.language
end

function AnnouncementMetaData:getTitle()
  return self.title
end

function AnnouncementMetaData:getContent()
  return self.content
end

function AnnouncementMetaData:getLanguage()
  return self.language
end

local this = class("announcementResponeDataInfo")

function this:ctor(csAnnouncementResponeDataInfo)
  self.name = csAnnouncementResponeDataInfo.name
  self.orderId = csAnnouncementResponeDataInfo.orderId
  self.tabId = csAnnouncementResponeDataInfo.tabId
  self.endTime = csAnnouncementResponeDataInfo.endTime
  self.id = csAnnouncementResponeDataInfo.id
  self.type = csAnnouncementResponeDataInfo.type
  self.jumpId = csAnnouncementResponeDataInfo.jumpId
  self.hide = csAnnouncementResponeDataInfo.hide
  self.showPosition = csAnnouncementResponeDataInfo.showPosition
  self.publishTime = csAnnouncementResponeDataInfo.publishTime
  self.announcementMetaDataList = {}
  local csAnnouncementResponeMetaDataList = csAnnouncementResponeDataInfo.meta
  for _, csAnnouncementResponeMetaData in pairs(csAnnouncementResponeMetaDataList) do
    local language = csAnnouncementResponeMetaData.language
    self.announcementMetaDataList[language] = AnnouncementMetaData.new(csAnnouncementResponeMetaData)
  end
end

function this:getAnnouncementMetaData(language)
  language = language or C_Define.language
  local curLanguage = "chs"
  if language ~= C_I18NConst.LanguageChs then
    curLanguage = language
  end
  return self.announcementMetaDataList[curLanguage]
end

return this
