├── GO_VERSION ├── static ├── style │ ├── config.css │ ├── config.less │ ├── common.css │ ├── common.less │ ├── mobile.css │ ├── mobile.less │ ├── handBook.css │ ├── handBook.less │ └── home.css ├── img │ ├── logo │ │ ├── logo.png │ │ ├── 溜忙logo.png │ │ ├── favicon_128.ico │ │ └── favicon_64.ico │ └── loading │ │ └── loading.jpg └── js │ └── emoji.js ├── utils ├── SpiderTask.go ├── JsonUtil.go ├── spider │ ├── SpiderTaskPolicy.go │ ├── CategoriesStr.go │ └── SpiderApi.go ├── Cron.go ├── RedisUtil.go ├── Pagination.go ├── Dingrobot.go └── Spider.go ├── model ├── paging.go ├── post.go ├── version.go ├── error.go ├── movie.go └── user.go ├── Dockerfile.API ├── Dockerfile.UI ├── .gitignore ├── Makefile ├── templates ├── components │ ├── footer.html │ ├── notification.html │ ├── header.html │ ├── examine.html │ ├── classification.html │ ├── header_createBlog.html │ ├── pagination.html │ ├── login.html │ ├── nav.html │ ├── header_ViewHandBook.html │ └── comment.html └── movie │ ├── movieDetail.html │ └── movie.html ├── error ├── notfound.go └── handler.go ├── runner └── runner.go ├── docker-compose.UI.yml ├── docker-compose.API.yml ├── .vscode └── launch.json ├── .github └── FUNDING.yml ├── config ├── app.go.backup └── config.go ├── mode ├── mode_test.go └── mode.go ├── test ├── asserts.go └── testdb │ └── database.go ├── README.md ├── test.http ├── api ├── internalutil.go ├── user_test.go ├── user.go ├── html.go ├── movie.go └── post.go ├── database ├── post_test.go ├── database.go ├── database_test.go ├── user_test.go ├── post.go ├── user.go └── movie.go ├── docker-compose-express-mongo.yml ├── LICENSE ├── go.mod ├── router └── router.go ├── app.go └── .drone.yml /GO_VERSION: -------------------------------------------------------------------------------- 1 | 1.12.0 2 | -------------------------------------------------------------------------------- /static/style/config.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/img/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhenquan321/movie-spider/HEAD/static/img/logo/logo.png -------------------------------------------------------------------------------- /static/img/logo/溜忙logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhenquan321/movie-spider/HEAD/static/img/logo/溜忙logo.png -------------------------------------------------------------------------------- /static/img/loading/loading.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhenquan321/movie-spider/HEAD/static/img/loading/loading.jpg -------------------------------------------------------------------------------- /static/img/logo/favicon_128.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhenquan321/movie-spider/HEAD/static/img/logo/favicon_128.ico -------------------------------------------------------------------------------- /static/img/logo/favicon_64.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhenquan321/movie-spider/HEAD/static/img/logo/favicon_64.ico -------------------------------------------------------------------------------- /utils/SpiderTask.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | type SpiderTask interface { 4 | Start() 5 | PageDetail(id string) 6 | } 7 | -------------------------------------------------------------------------------- /static/style/config.less: -------------------------------------------------------------------------------- 1 | @mainColor: #e59233; 2 | @mainColorHover: #c67e2b; 3 | @Bghover:#fafafa; 4 | @boxShadow:0 1px 2px 0 rgba(0, 0, 0, 0.05); -------------------------------------------------------------------------------- /utils/JsonUtil.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import jsoniter "github.com/json-iterator/go" 4 | 5 | var Json = jsoniter.ConfigCompatibleWithStandardLibrary 6 | -------------------------------------------------------------------------------- /model/paging.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | // Paging Model 4 | type Paging struct { 5 | Skip *int64 6 | Limit *int64 7 | SortKey string 8 | SortVal int 9 | Condition interface{} 10 | } 11 | -------------------------------------------------------------------------------- /Dockerfile.API: -------------------------------------------------------------------------------- 1 | FROM frolvlad/alpine-glibc:glibc-2.29 2 | 3 | WORKDIR /bin 4 | ADD release/linux/amd64/api-ten-minutes /bin/ 5 | ADD config.yml /bin/ 6 | 7 | EXPOSE 6868 8 | ENTRYPOINT ["/bin/api-ten-minutes"] 9 | -------------------------------------------------------------------------------- /Dockerfile.UI: -------------------------------------------------------------------------------- 1 | FROM node:10.15.1-alpine 2 | 3 | RUN apk add --no-cache tini && npm install http-server -g && mkdir /ten 4 | 5 | WORKDIR /ten 6 | 7 | COPY app/build . 8 | 9 | EXPOSE 3000 10 | 11 | ENTRYPOINT ["/sbin/tini", "--"] 12 | CMD [ "http-server", "-p", "3000" ] 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | config.yml 8 | 9 | # Test binary, build with `go test -c` 10 | *.test 11 | 12 | # Output of the go coverage tool, specifically when used with LiteIDE 13 | *.out 14 | 15 | .DS_Store 16 | un 17 | release -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | DOCKER_GO_BUILD=go build -mod=readonly -a -installsuffix cgo -ldflags "$$LD_FLAGS" 2 | 3 | build_linux_amd64: 4 | CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ${DOCKER_GO_BUILD} -v -o release/linux/amd64/api-ten-minutes 5 | 6 | docker: 7 | docker build -t lotteryjs/api-ten-minutes . 8 | 9 | test: 10 | go test -v . -------------------------------------------------------------------------------- /utils/spider/SpiderTaskPolicy.go: -------------------------------------------------------------------------------- 1 | package spider 2 | 3 | import ( 4 | "movie_spider/utils" 5 | 6 | "github.com/spf13/viper" 7 | ) 8 | 9 | // 定义 mod 的映射关系 10 | var spiderModMap = map[string]utils.SpiderTask{ 11 | "api": &SpiderApi{}, 12 | "WebPage": &utils.Spider{}} 13 | 14 | func Create() utils.SpiderTask { 15 | 16 | mod := viper.GetString(`app.spider_mod`) 17 | 18 | return spiderModMap[mod] 19 | } 20 | -------------------------------------------------------------------------------- /templates/components/footer.html: -------------------------------------------------------------------------------- 1 | 2 |
5 |