mtsc

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	mvcs.Model
	Table string
	DB    func() *gorm.DB
}

func (*Model) Count

func (m *Model) Count(where []interface{}) int64

func (*Model) Delete

func (m *Model) Delete(where []interface{}) error

func (*Model) Find

func (m *Model) Find(dest interface{}, where []interface{}, fields, order string, offset, limit int)

func (*Model) FindOne

func (m *Model) FindOne(dest interface{}, where []interface{}, fields, order string)

func (*Model) Save

func (m *Model) Save(value interface{}, id ...int) (interface{}, error)

func (*Model) Update

func (m *Model) Update(where []interface{}, value interface{}) error

type Redis

type Redis struct {
	mvcs.Redis
	Client func() *redis.Client
}

func (*Redis) CacheWithString

func (r *Redis) CacheWithString(key string, output interface{}, expiration time.Duration, fn func() (interface{}, bool)) error

从String类型的缓存中读取数据,如没则重新调用指定方法重新从数据库中读取并写入缓存

func (*Redis) DeleteCache

func (r *Redis) DeleteCache(key ...string) (int64, error)

DeleteCache 根据key删除对应缓存 @receiver r *Redis @author Cloud|2021-12-07 13:56:08 @param key ...string ... @return int64 ... @return error ...

func (*Redis) HashGetAll

func (r *Redis) HashGetAll(key string) (result []interface{})

HashGetAll ... @receiver r *Redis @author Cloud|2021-12-15 10:10:46 @param key string ... @return result []interface{} ...

func (*Redis) HashMultiDelete

func (r *Redis) HashMultiDelete(key string, fields ...string) error

HashMultiDelete ... @receiver r *Redis @author Cloud|2021-12-15 10:49:15 @param key string ... @param fields ...string ... @return error ...

func (*Redis) HashMultiSet

func (r *Redis) HashMultiSet(key string, data map[string]interface{}) error

HashMultiSet ... @receiver r *Redis @author Cloud|2021-12-15 10:10:49 @param key string ... @param data map[string]interface{} ... @return error ...

func (*Redis) NoDataExpiration

func (r *Redis) NoDataExpiration() time.Duration

数据不存在情况下,为防止缓存雪崩,随机返回一个30到60秒的有效时间

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) Construct

func (s *Service) Construct(sr interface{}, ctx context.Context, args map[string]interface{}, reply *interface{})

func (*Service) Finish

func (s *Service) Finish(data interface{}) error

Finish ... @receiver s *Service @author Cloud|2021-12-23 11:42:27 @param data interface{} ... @return error ...

func (*Service) GetArgs

func (s *Service) GetArgs(key string, defaultValue ...interface{}) interface{}

GetArgs 获取客户端传参值 @receiver s *Service @author Cloud|2021-12-02 16:18:05 @param key string ... @param defaultValue ...interface{} ... @return interface{} ...

func (*Service) GetInt

func (s *Service) GetInt(key string, defaultValue ...int) int

GetInt .获取客户端int传值 @receiver s *Service @author Cloud|2021-12-23 11:42:24 @param key string ... @param defaultValue ...int ... @return int ...

func (*Service) GetInt64

func (s *Service) GetInt64(key string, defaultValue ...int64) int64

GetInt64 ... @receiver s *Service @author Cloud|2021-12-23 11:55:53 @param key string ... @param defaultValue ...int64 ... @return int64 ...

func (*Service) GetString

func (s *Service) GetString(key string, defaultValue ...string) string

GetString 获取客户端字符串传值 @receiver s *Service @author Cloud|2021-12-23 11:41:56 @param key string ... @param defaultValue ...string ... @return string ...

func (*Service) Json

func (s *Service) Json(args ...interface{}) error

Json ... @receiver s *Service @author Cloud|2021-12-07 14:12:03 @param args ...interface{} ... @return error ...

func (*Service) LoggedUserData

func (s *Service) LoggedUserData(key ...string) map[string]interface{}

LoggedUserData 获取APP登录用户数据 @receiver s *Service @author Cloud|2021-12-02 17:08:20 @param key ...string ... @return map[string]interface{} ...

func (*Service) LoggedUserId

func (s *Service) LoggedUserId(key ...string) int

LoggedUserId 获取APP登陆用户的user_id @receiver s *Service @author Cloud|2021-12-22 18:38:51 @param key ...string ... @return int ...

func (*Service) LoginCheck

func (s *Service) LoginCheck(key ...string) bool

LoginCheck APP登录检查 @receiver s *Service @author Cloud|2021-12-02 17:07:53 @param key ...string ... @return bool ...

func (*Service) Record

func (s *Service) Record(r define.Record)

Record ... @receiver s *Service @author Cloud|2021-12-07 15:31:39 @param r define.Record ...

func (*Service) SignCheck

func (s *Service) SignCheck() bool

SignCheck APP签名验证 @receiver s *Service @author Cloud|2021-12-02 16:57:44 @return bool ...

Jump to

Keyboard shortcuts

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