move external API docking code to extra package from data

This commit is contained in:
A.C.Sukazyo Eyre 2023-11-29 00:15:13 +08:00
parent a9767ec1b0
commit 3d1699ea1d
Signed by: Eyre_S
GPG Key ID: C17CE40291207874
29 changed files with 40 additions and 38 deletions

View File

@ -5,7 +5,7 @@ MORNY_ARCHIVE_NAME = morny-coeur
MORNY_CODE_STORE = https://github.com/Eyre-S/Coeur-Morny-Cono
MORNY_COMMIT_PATH = https://github.com/Eyre-S/Coeur-Morny-Cono/commit/%s
VERSION = 1.3.0-dev11
VERSION = 1.3.0-dev11.1
USE_DELTA = false
VERSION_DELTA =

View File

@ -1,11 +1,12 @@
package cc.sukazyo.cono.morny.bot.command
import cc.sukazyo.cono.morny.data.{twitter, weibo, TelegramStickers}
import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.util.tgapi.InputCommand
import cc.sukazyo.cono.morny.MornyCoeur
import cc.sukazyo.cono.morny.data.twitter.{FXApi, TweetUrlInformation}
import cc.sukazyo.cono.morny.extra.{twitter, weibo}
import cc.sukazyo.cono.morny.extra.twitter.{FXApi, TweetUrlInformation}
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Bot.exec
import cc.sukazyo.cono.morny.Log.{exceptionLog, logger}
import cc.sukazyo.cono.morny.data.weibo.StatusUrlInfo
import cc.sukazyo.cono.morny.extra.weibo.StatusUrlInfo
import com.pengrad.telegrambot.model.Update
import com.pengrad.telegrambot.model.request.{InputMedia, InputMediaPhoto, InputMediaVideo, ParseMode}
import com.pengrad.telegrambot.request.{SendMediaGroup, SendMessage, SendSticker}

View File

@ -1,7 +1,7 @@
package cc.sukazyo.cono.morny.bot.command
import cc.sukazyo.cono.morny.MornyCoeur
import cc.sukazyo.cono.morny.data.ip186.IP186QueryHandler
import cc.sukazyo.cono.morny.extra.ip186.IP186QueryHandler
import cc.sukazyo.cono.morny.util.tgapi.InputCommand
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Bot.exec
import com.pengrad.telegrambot.model.Update

View File

@ -1,7 +1,8 @@
package cc.sukazyo.cono.morny.bot.command
import cc.sukazyo.cono.morny.MornyCoeur
import cc.sukazyo.cono.morny.data.{NbnhhshQuery, TelegramStickers}
import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.extra.NbnhhshQuery
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramParseEscape.escapeHtml as h
import cc.sukazyo.cono.morny.util.tgapi.InputCommand
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Bot.exec

View File

@ -24,7 +24,7 @@ class ShareToolBilibili (using coeur: MornyCoeur) extends ITelegramQuery {
if (event.inlineQuery.query == null) return null
if (event.inlineQuery.query isBlank) return null
import cc.sukazyo.cono.morny.data.BilibiliForms.*
import cc.sukazyo.cono.morny.extra.BilibiliForms.*
val result: BiliVideoId =
try
parse_videoUrl(event.inlineQuery.query)

View File

@ -1,7 +1,7 @@
package cc.sukazyo.cono.morny.bot.query
import cc.sukazyo.cono.morny.data.twitter
import cc.sukazyo.cono.morny.data.twitter.TweetUrlInformation
import cc.sukazyo.cono.morny.extra.twitter
import cc.sukazyo.cono.morny.extra.twitter.TweetUrlInformation
import cc.sukazyo.cono.morny.util.tgapi.formatting.NamingUtils.inlineQueryId
import com.pengrad.telegrambot.model.Update
import com.pengrad.telegrambot.model.request.InlineQueryResultArticle

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data
package cc.sukazyo.cono.morny.extra
import cc.sukazyo.cono.morny.util.BiliTool
import cc.sukazyo.cono.morny.util.SttpPublic.{mornyBasicRequest, Schemes}

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data
package cc.sukazyo.cono.morny.extra
import cc.sukazyo.cono.morny.util.SttpPublic.mornyBasicRequest
import com.google.gson.Gson

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.ip186
package cc.sukazyo.cono.morny.extra.ip186
import cc.sukazyo.cono.morny.util.SttpPublic.{mornyBasicRequest, Schemes}
import sttp.client3.{asString, HttpError, SttpClientException, UriContext}

View File

@ -1,3 +1,3 @@
package cc.sukazyo.cono.morny.data.ip186
package cc.sukazyo.cono.morny.extra.ip186
case class IP186Response (url: String, body: String)

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.twitter
package cc.sukazyo.cono.morny.extra.twitter
import cc.sukazyo.cono.morny.util.SttpPublic
import cc.sukazyo.cono.morny.util.SttpPublic.mornyBasicRequest

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.twitter
package cc.sukazyo.cono.morny.extra.twitter
/** Information about the author of a tweet.
*

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.twitter
package cc.sukazyo.cono.morny.extra.twitter
/** Data for external media, currently only video.
*

View File

@ -1,6 +1,6 @@
package cc.sukazyo.cono.morny.data.twitter
package cc.sukazyo.cono.morny.extra.twitter
import cc.sukazyo.cono.morny.data.twitter.FXMosaicPhoto.formatsType
import cc.sukazyo.cono.morny.extra.twitter.FXMosaicPhoto.formatsType
/** Data for the mosaic service, which stitches photos together
*

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.twitter
package cc.sukazyo.cono.morny.extra.twitter
/** This can help compare items in a pool of media
*

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.twitter
package cc.sukazyo.cono.morny.extra.twitter
/** Data for a poll on a given Tweet.
*

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.twitter
package cc.sukazyo.cono.morny.extra.twitter
/** Data for a single choice in a poll
*

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.twitter
package cc.sukazyo.cono.morny.extra.twitter
/** Information about a requested translation for a Tweet, when asked.
*

View File

@ -1,6 +1,6 @@
package cc.sukazyo.cono.morny.data.twitter
package cc.sukazyo.cono.morny.extra.twitter
import cc.sukazyo.cono.morny.data.twitter.FXTweet.mediaType
import cc.sukazyo.cono.morny.extra.twitter.FXTweet.mediaType
import cc.sukazyo.cono.morny.util.EpochDateTime.EpochSeconds
/** The container of all the information for a Tweet.

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.twitter
package cc.sukazyo.cono.morny.extra.twitter
/** Data for a Tweet's video
*

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data
package cc.sukazyo.cono.morny.extra
import scala.util.matching.Regex

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.weibo
package cc.sukazyo.cono.morny.extra.weibo
case class MApi [D] (
ok: Int,

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.weibo
package cc.sukazyo.cono.morny.extra.weibo
case class MPic (
pid: String,

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.weibo
package cc.sukazyo.cono.morny.extra.weibo
case class MStatus (

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data.weibo
package cc.sukazyo.cono.morny.extra.weibo
case class MUser (

View File

@ -1,4 +1,4 @@
package cc.sukazyo.cono.morny.data
package cc.sukazyo.cono.morny.extra
package object weibo {

View File

@ -1,6 +1,6 @@
package cc.sukazyo.cono.morny.test.data
package cc.sukazyo.cono.morny.test.extra
import cc.sukazyo.cono.morny.data.BilibiliForms.*
import cc.sukazyo.cono.morny.extra.BilibiliForms.*
import cc.sukazyo.cono.morny.test.MornyTests
import org.scalatest.prop.TableDrivenPropertyChecks
import org.scalatest.tagobjects.{Network, Slow}

View File

@ -1,7 +1,7 @@
package cc.sukazyo.cono.morny.test.data.twitter
package cc.sukazyo.cono.morny.test.extra.twitter
import cc.sukazyo.cono.morny.data.twitter.FXApi
import cc.sukazyo.cono.morny.data.twitter.FXApi.Fetch
import cc.sukazyo.cono.morny.extra.twitter.FXApi
import cc.sukazyo.cono.morny.extra.twitter.FXApi.Fetch
import cc.sukazyo.cono.morny.test.MornyTests
import org.scalatest.prop.TableDrivenPropertyChecks
import org.scalatest.tagobjects.{Network, Slow}

View File

@ -1,6 +1,6 @@
package cc.sukazyo.cono.morny.test.data.twitter
package cc.sukazyo.cono.morny.test.extra.twitter
import cc.sukazyo.cono.morny.data.twitter.{parseTweetUrl, TweetUrlInformation}
import cc.sukazyo.cono.morny.extra.twitter.{parseTweetUrl, TweetUrlInformation}
import cc.sukazyo.cono.morny.test.MornyTests
class PackageTest extends MornyTests {