Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"item.go",
"pro.go",
"service.go",
],
importpath = "go-common/app/interface/openplatform/seo/service",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/interface/openplatform/seo/conf:go_default_library",
"//app/interface/openplatform/seo/dao:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,11 @@
package service
import (
"context"
)
// GetItem get item detail
func (s *Service) GetItem(c context.Context, id int, bot bool) (res []byte, err error) {
res, err = s.dao.GetItem(c, id, bot)
return
}

View File

@@ -0,0 +1,11 @@
package service
import (
"context"
)
// GetPro get project detail
func (s *Service) GetPro(c context.Context, id int, bot bool) (res []byte, err error) {
res, err = s.dao.GetPro(c, id, bot)
return
}

View File

@@ -0,0 +1,38 @@
package service
import (
"context"
"go-common/app/interface/openplatform/seo/conf"
"go-common/app/interface/openplatform/seo/dao"
)
// Service struct
type Service struct {
c *conf.Config
dao *dao.Dao
}
// New init
func New(c *conf.Config) (s *Service) {
s = &Service{
c: c,
dao: dao.New(c),
}
return s
}
// Ping .
func (s *Service) Ping(c context.Context) (err error) {
return s.dao.Ping(c)
}
// Close .
func (s *Service) Close() {
s.dao.Close()
}
// Sitemap 生成站点地图
func (s *Service) Sitemap(c context.Context, host string) ([]byte, error) {
return s.dao.Sitemap(c, host)
}