authorized

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheAuthorizedData

type CacheAuthorizedData struct {
	Key    string         `json:"key"`     // 调用方 key
	Secret string         `json:"secret"`  // 调用方 secret
	IsUsed int32          `json:"is_used"` // 调用方启用状态 1=启用 -1=禁用
	Apis   []cacheApiData `json:"apis"`    // 调用方授权的 Apis
}

CacheAuthorizedData 缓存结构

type CreateAuthorizedAPIData

type CreateAuthorizedAPIData struct {
	BusinessKey string `json:"business_key"` // 调用方key
	Method      string `json:"method"`       // 请求方法
	API         string `json:"api"`          // 请求地址
}

type CreateAuthorizedData

type CreateAuthorizedData struct {
	BusinessKey       string `json:"business_key"`       // 调用方key
	BusinessDeveloper string `json:"business_developer"` // 调用方对接人
	Remark            string `json:"remark"`             // 备注
}

type SearchAPIData

type SearchAPIData struct {
	BusinessKey string `json:"business_key"` // 调用方key
}

type SearchData

type SearchData struct {
	Page              int    `json:"page"`               // 第几页
	PageSize          int    `json:"page_size"`          // 每页显示条数
	BusinessKey       string `json:"business_key"`       // 调用方key
	BusinessSecret    string `json:"business_secret"`    // 调用方secret
	BusinessDeveloper string `json:"business_developer"` // 调用方对接人
	Remark            string `json:"remark"`             // 备注
}

type Service

type Service interface {
	Create(ctx context.Context, authorizedData *CreateAuthorizedData) (id int64, err error)
	List(ctx context.Context, searchData *SearchData) (listData []*authorized.Authorized, err error)
	PageList(ctx context.Context, searchData *SearchData) (listData []*authorized.Authorized, err error)
	PageListCount(ctx context.Context, searchData *SearchData) (total int64, err error)
	UpdateUsed(ctx context.Context, id int64, used int32) (err error)
	Delete(ctx context.Context, id int64) (err error)
	Detail(ctx context.Context, id int64) (info *authorized.Authorized, err error)
	DetailByKey(ctx context.Context, key string) (data *CacheAuthorizedData, err error)

	CreateAPI(ctx context.Context, authorizedAPIData *CreateAuthorizedAPIData) (id int64, err error)
	ListAPI(ctx context.Context, searchAPIData *SearchAPIData) (listData []*authorized_api.AuthorizedApi, err error)
	DeleteAPI(ctx context.Context, id int64) (err error)
	// contains filtered or unexported methods
}

func New

func New() Service

Jump to

Keyboard shortcuts

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