Documentation ¶
Index ¶
- type Model
- func (m *Model) Count(where []interface{}) int64
- func (m *Model) Delete(where []interface{}) error
- func (m *Model) Find(dest interface{}, where []interface{}, fields, order string, offset, limit int)
- func (m *Model) FindOne(dest interface{}, where []interface{}, fields, order string)
- func (m *Model) Save(value interface{}, id ...int) (interface{}, error)
- func (m *Model) Update(where []interface{}, value interface{}) error
- type Redis
- func (r *Redis) CacheWithString(key string, output interface{}, expiration time.Duration, ...) error
- func (r *Redis) DeleteCache(key ...string) (int64, error)
- func (r *Redis) HashGetAll(key string) (result []interface{})
- func (r *Redis) HashMultiDelete(key string, fields ...string) error
- func (r *Redis) HashMultiSet(key string, data map[string]interface{}) error
- func (r *Redis) NoDataExpiration() time.Duration
- type Service
- func (s *Service) Construct(sr interface{}, ctx context.Context, args map[string]interface{}, ...)
- func (s *Service) Finish(data interface{}) error
- func (s *Service) GetArgs(key string, defaultValue ...interface{}) interface{}
- func (s *Service) GetInt(key string, defaultValue ...int) int
- func (s *Service) GetInt64(key string, defaultValue ...int64) int64
- func (s *Service) GetString(key string, defaultValue ...string) string
- func (s *Service) Json(args ...interface{}) error
- func (s *Service) LoggedUserData(key ...string) map[string]interface{}
- func (s *Service) LoggedUserId(key ...string) int
- func (s *Service) LoginCheck(key ...string) bool
- func (s *Service) Record(r define.Record)
- func (s *Service) SignCheck() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Redis ¶
func (*Redis) CacheWithString ¶
func (r *Redis) CacheWithString(key string, output interface{}, expiration time.Duration, fn func() (interface{}, bool)) error
从String类型的缓存中读取数据,如没则重新调用指定方法重新从数据库中读取并写入缓存
func (*Redis) DeleteCache ¶
DeleteCache 根据key删除对应缓存 @receiver r *Redis @author Cloud|2021-12-07 13:56:08 @param key ...string ... @return int64 ... @return error ...
func (*Redis) HashGetAll ¶
HashGetAll ... @receiver r *Redis @author Cloud|2021-12-15 10:10:46 @param key string ... @return result []interface{} ...
func (*Redis) HashMultiDelete ¶
HashMultiDelete ... @receiver r *Redis @author Cloud|2021-12-15 10:49:15 @param key string ... @param fields ...string ... @return error ...
func (*Redis) HashMultiSet ¶
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 ¶
数据不存在情况下,为防止缓存雪崩,随机返回一个30到60秒的有效时间
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Finish ¶
Finish ... @receiver s *Service @author Cloud|2021-12-23 11:42:27 @param data interface{} ... @return error ...
func (*Service) GetArgs ¶
GetArgs 获取客户端传参值 @receiver s *Service @author Cloud|2021-12-02 16:18:05 @param key string ... @param defaultValue ...interface{} ... @return interface{} ...
func (*Service) GetInt ¶
GetInt .获取客户端int传值 @receiver s *Service @author Cloud|2021-12-23 11:42:24 @param key string ... @param defaultValue ...int ... @return int ...
func (*Service) GetInt64 ¶
GetInt64 ... @receiver s *Service @author Cloud|2021-12-23 11:55:53 @param key string ... @param defaultValue ...int64 ... @return int64 ...
func (*Service) GetString ¶
GetString 获取客户端字符串传值 @receiver s *Service @author Cloud|2021-12-23 11:41:56 @param key string ... @param defaultValue ...string ... @return string ...
func (*Service) Json ¶
Json ... @receiver s *Service @author Cloud|2021-12-07 14:12:03 @param args ...interface{} ... @return error ...
func (*Service) LoggedUserData ¶
LoggedUserData 获取APP登录用户数据 @receiver s *Service @author Cloud|2021-12-02 17:08:20 @param key ...string ... @return map[string]interface{} ...
func (*Service) LoggedUserId ¶
LoggedUserId 获取APP登陆用户的user_id @receiver s *Service @author Cloud|2021-12-22 18:38:51 @param key ...string ... @return int ...
func (*Service) LoginCheck ¶
LoginCheck APP登录检查 @receiver s *Service @author Cloud|2021-12-02 17:07:53 @param key ...string ... @return bool ...