model

package
v0.0.0-...-33b3637 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const NewAnimeUrl = "https://acg.gamer.com.tw/quarterly.php?"

https://acg.gamer.com.tw/quarterly.php?page=2&d=0

Variables

View Source
var DB *gorm.DB

Functions

func AutoUpdate

func AutoUpdate()

用以定時檢測有無新番更新

func CheckColonExist

func CheckColonExist(str string) string

func ConnectDataBase

func ConnectDataBase(dbname string)

func CreateACGTable

func CreateACGTable()

func CreateNewAnimeTable

func CreateNewAnimeTable()

func CreateUserTable

func CreateUserTable()

func CrewAnimerInfo

func CrewAnimerInfo()

建立動漫的資料庫 https://acg.gamer.com.tw/index.php?page=2&p=ANIME&t=1&tnum=5406

func CrewEachAnime

func CrewEachAnime(urls []string)

func CrewEachAnimeTest

func CrewEachAnimeTest(_url string)

func CrewNewAnimeInfo

func CrewNewAnimeInfo()

func CrewNewAnimePageUrl

func CrewNewAnimePageUrl(url string) ([]string, []int)

func CrewSinglePage

func CrewSinglePage(url string) []string

func CrewSinglePageTest

func CrewSinglePageTest(url string)

func NewAnimeSortTest

func NewAnimeSortTest()

func SearchUserInfo

func SearchUserInfo(userID string)

func Test

func Test()

func UpdateAnimesInfo

func UpdateAnimesInfo()

更新人氣以及還未放入資料庫的作品

func UpdateNewAnimeImage

func UpdateNewAnimeImage()

func VerifyAnime

func VerifyAnime(anime *ACG)

Types

type ACG

type ACG struct {
	SearchIndex string `gorm:"size:50;"`                        // 動漫編號
	Image       string `gorm:"size:150;"`                       // 首頁影像圖片網址
	TaiName     string `gorm:"primary_key; size:90; not null;"` // 動畫台灣翻譯名稱
	JapName     string `gorm:"size:90; not null;"`              // 動畫日文原名
	Class       string `gorm:"size:60;"`                        // 動畫種類(電影or番)
	Premiere    string `gorm:"size:60;"`                        // 首播時間
	Author      string `gorm:"size:60;"`                        // 原著作者
	Director    string `gorm:"size:60;"`                        // 導演監督
	Firm        string `gorm:"size:60;"`                        // 製作廠商
	Agent       string `gorm:"size:60;"`                        // 台灣代理
	Website     string `gorm:"size:150;"`                       // 官方網站
	Popularity  int
}

func GetAnimeInfo

func GetAnimeInfo(_url string) (ACG, error)

func SearchAnimeInfoWithAuthor

func SearchAnimeInfoWithAuthor(author string) []ACG

func SearchAnimeInfoWithKey

func SearchAnimeInfoWithKey(key string) []ACG

如果該作品有欄位為空, 填入nil以便於flex可以正常運作

func SearchAnimeInfoWithindex

func SearchAnimeInfoWithindex(_url string) (ACG, error)

func (ACG) IsEmpty

func (anime ACG) IsEmpty() bool

type NewAnime

type NewAnime struct {
	SearchIndex string `gorm:"primary_key; size:50; not null;"` // 動漫編號
	Popularity  int    // 人氣
	Followers   int    // 追隨數
	ImageSrc    string `gorm:"size:150;"` //首頁圖片
	TaiName     string `gorm:"size:90;"`  // 中文譯名
	JapName     string `gorm:"size:90;"`  // 原作名稱
	Class       string `gorm:"size:60;"`  // 動畫種類(電影or番)
	Premiere    string `gorm:"size:60;"`  // 首播時間
	Author      string `gorm:"size:60;"`  // 原著作者
	Director    string `gorm:"size:60;"`  // 導演監督
	Firm        string `gorm:"size:60;"`  // 製作廠商
	Agent       string `gorm:"size:60;"`  // 台灣代理
	Website     string `gorm:"size:150;"` // 官方網站
}

func CrewEachNewAnime

func CrewEachNewAnime(urls []string) []NewAnime

type NewAnimes

type NewAnimes []NewAnime

func (NewAnimes) Len

func (na NewAnimes) Len() int

Sort interface 三必要條件

func (NewAnimes) Less

func (na NewAnimes) Less(i, j int) bool

func (NewAnimes) Swap

func (na NewAnimes) Swap(i, j int)

type User

type User struct {
	UserID      string `gorm:"primary_key; size:50;"`
	SearchIndex string `gorm:"primary_key; size:50;"`
	Handle      bool   `gorm:"not null;"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL