Open unissoft-bj opened 9 years ago
mysql> select * from role; +----+--------------+ | id | name | +----+--------------+ | 1 | ROLE_USER | | 2 | ROLE_MANAGER | | 3 | ROLE_SALES | | 4 | ROLE_SERVICE |
Json input:
{"userRole":"ROLE_SALES","phone":"1380796221","type":"sms"}
returned json example: { id: 1 phone: "1380796221" token: 870805 agent_id: "90b1e606-dfd3-11e4-90f4-000c29c5df73" create_t: 1428900355092 used: false }
rest call example: post http://ihost:8080/secure/shangwangma
body: {"userRole":"ROLE_USER","phone":"5016548878","type":"sms"}
return: { id: 2 phone: "5016548878" token: 503336 agent_id: "4028a7814cb58e21014cb5901ace0000" create_t: 1429540389899 used: false mac: "" user_role: "ROLE_USER" }
功能:为用户发放上网码;前端直接呈现给顾客;或者以短信方式发送给顾客(暂不做)
提交参数:phone,有效期(默认24小时);phone可以没有;没有phone意味着临时上网码 返回参数:上网码
rest 逻辑: 1,接收phone,有效期 2,生成6位数的上网码 3,在“码表”中创建上网码记录:phone,上网码,role(普通顾客、销售顾问、客服、销售经理)有效期,发送方式(短信、直接呈现),销售顾问id 4,返回上网码