service

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 4 Imported by: 0

README

service

业务逻辑层,处于 server 层和 dao 层之间。service 只能通过 dao 层获取数据。

业务接口必须接受 ctx context.Context 对象,并向下传递。

错误日志

框架支持自动打印错误日志,使用方法:

import "github.com/busyfree/shorturl-go/util/errors"

// ...

return errors.Wrap(err)
// 如果有附加信息,则可以
return errors.Wrap(err, "extram msg")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SyncXORMTables

func SyncXORMTables()

Types

type LinkService

type LinkService struct {
	Dao *dao.LinkDao
}

func NewLinkService

func NewLinkService() *LinkService
func (s *LinkService) FindOneLink(ctx context.Context) (err error)

func (*LinkService) FindOneLinkByCode

func (s *LinkService) FindOneLinkByCode(ctx context.Context) (err error)

func (*LinkService) FindOneLinkByCodeFromMongoDB

func (s *LinkService) FindOneLinkByCodeFromMongoDB(ctx context.Context) (err error)

func (*LinkService) FindOneLinkByHash

func (s *LinkService) FindOneLinkByHash(ctx context.Context) (err error)

func (*LinkService) FindOneLinkByHashFromMongoDB

func (s *LinkService) FindOneLinkByHashFromMongoDB(ctx context.Context) (err error)

func (*LinkService) FindOneLinkByKey

func (s *LinkService) FindOneLinkByKey(ctx context.Context) (err error)
func (s *LinkService) SaveOneLink(ctx context.Context) (err error)

func (*LinkService) SaveOneLinkToMongoDB

func (s *LinkService) SaveOneLinkToMongoDB(ctx context.Context) (err error)

func (*LinkService) SaveOneLinkToMySQL

func (s *LinkService) SaveOneLinkToMySQL(ctx context.Context) (err error)

Jump to

Keyboard shortcuts

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