redis-cli
127.0.0.1:6379> set user_info;;user_id;;login_times 0
#when attempt to login
127.0.0.1:6379> incrby user_info;;user_Id;;login_times 1
st=>start: Start
e=>end: End
op1=>operation: Input username/password
op2=>operation: Attempt Login
cond1=>condition: user_info;;user_Id;;login_times > 3 ?
op3=>operation: Lock account
cond2=>condition: username/password correct ?
op4=>operation: Login Success
op5=>operation: incrby user_info;;user_Id;;login_times 1
op6=>operation: set user_info;;user_Id;;login_times 0
cond3=>condition: Account Lock ?
st->op1->op2->cond3->cond1->e
cond1(yes)->op3->e
cond1(no)->cond2
cond2(yes)->op4->op6->e
cond2(no)->op5->op1
cond3(no)->cond1
cond3(yes)->e