Skip to content

Commit

Permalink
结构调整
Browse files Browse the repository at this point in the history
  • Loading branch information
李信 committed Aug 8, 2018
1 parent 8d04789 commit a715c47
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 301 deletions.
26 changes: 0 additions & 26 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -67,32 +67,6 @@ http {
server_name 127.0.0.1 localhost;



location /redis_zrangebyscore{
default_type 'text/html';
lua_need_request_body on;
content_by_lua_file fengtrust/ft_redis/rdszrangebyscore.lua;
}
location /redis_zremrangebyscore{
default_type 'text/html';
lua_need_request_body on;
content_by_lua_file fengtrust/ft_redis/rdszremrangebyscore.lua;
}
location /redis_zrevrange{
default_type 'text/html';
lua_need_request_body on;
content_by_lua_file fengtrust/ft_redis/rdszrevrange.lua;
}
location /redis_zadd{
default_type 'text/html';
lua_need_request_body on;
content_by_lua_file fengtrust/ft_redis/rdszadd.lua;
}
location /redis_zcount{
default_type 'text/html';
lua_need_request_body on;
content_by_lua_file fengtrust/ft_redis/rdszcount.lua;
}
location /getlog {
default_type 'text/html';
lua_need_request_body on;
Expand Down
23 changes: 0 additions & 23 deletions redis/rdsexists.lua

This file was deleted.

30 changes: 0 additions & 30 deletions redis/rdszadd.lua

This file was deleted.

39 changes: 0 additions & 39 deletions redis/rdszcount.lua

This file was deleted.

40 changes: 0 additions & 40 deletions redis/rdszrangebyscore.lua

This file was deleted.

39 changes: 0 additions & 39 deletions redis/rdszremrangebyscore.lua

This file was deleted.

38 changes: 0 additions & 38 deletions redis/rdszrevrange.lua

This file was deleted.

29 changes: 28 additions & 1 deletion util/redisOP.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local _M = {
}


function _M.addlog2redis(key,score,value)
function _M.zadd(key,score,value)
local red = redis.new()
local res, err = red:exec(
function(red)
Expand Down Expand Up @@ -50,5 +50,32 @@ function _M.rdsexpir(key,time)
)
return err
end
function _M.zcount(key,start,endt)
local red = redis.new()
local res, err = red:exec(
function(red)
return red:zcount(key,start,endt)
end
)
if(err)then
return err
else
-- ngx.log(ngx.ERR,json.encode(res))
return(cjson.encode(res))
end
end
function _M.zrevrange(key,start,endt)
local red = redis.new()
local res, err = red:exec(
function(red)
return red:zrevrange(key,start,endt)
end
)
if(err)then
return err
else
return(cjson.encode(res))
end
end

return _M
Loading

0 comments on commit a715c47

Please sign in to comment.