Commit 890b7026 by 宋毅

tj

parent 8bec8718
......@@ -4,6 +4,7 @@ class AccessAuthAPI extends WEBBase {
constructor() {
super();
this.utilsAuthSve = system.getObject("service.utilsSve.utilsAuthSve");
this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve");
}
/**
* 接口跳转-POST请求
......@@ -29,13 +30,34 @@ class AccessAuthAPI extends WEBBase {
case "test"://测试
opResult = system.getResultSuccess(null, "测试成功");
break;
case "getUserPinByChannelUserId"://获取渠道用户userpin信息,通过userName
opResult = await this.utilsAuthSve.getUserPinByChannelUserId(pobj, pobj.actionBody);
if (opResult.status == 0) {
return system.getResultSuccess({ userpin: pobj.actionBody.userpin })
case "getNeedUserPinByChannelUserId"://渠道通过账户进行登录,有则返回用户信息,没有则创建用户
opResult = await this.utilsAuthSve.getLoginByUserName(pobj, pobj.actionBody);
if (opResult.status != 0 && opResult.status != 2060) {
return opResult;
}
opResult = system.getResultSuccess({ userpin: pobj.actionBody.userpin })
if (opResult.status == 2060) {
opResult.msg = opResult.msg;
opResult.data.userpin = opResult.data.userpin;
}
//获取需求信息
pobj.actionType = "getItemByNeedNo";
var needResult = await this.utilsNeedSve.getItemByNeedNo(pobj, pobj.actionBody);
if (needResult.status != 0) {
return needResult;
}
opResult.data.channelTypeCode = needResult.data.channelTypeCode;
opResult.data.typeCode = needResult.data.typeCode
break;
case "getLoginByUserName"://渠道通过账户进行登录,有则返回用户信息,没有则创建用户
opResult = await this.utilsAuthSve.getLoginByUserName(pobj, pobj.actionBody);
if (opResult.status != 0 && opResult.status != 2060) {
return opResult;
}
opResult = system.getResultSuccess({ userpin: pobj.actionBody.userpin })
if (opResult.status == 2060) {
return system.getResultSuccess({ userpin: opResult.data.userpin }, opResult.msg)
opResult.msg = opResult.msg;
opResult.data.userpin = opResult.data.userpin;
}
break;
case "getVerifyCode"://获取默认模板的手机验证码
......
......@@ -4,6 +4,7 @@ var settings = require("../../../../config/settings");
class Need extends APIBase {
constructor() {
super();
this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve");
}
/**
......@@ -25,7 +26,11 @@ class Need extends APIBase {
async opActionProcess(pobj, action_process, action_type, action_body, req) {
var opResult = null;
switch (action_type) {
case "close"://关闭需求
case "submitNeed"://提交需求
opResult = await this.utilsNeedSve.submitNeed(pobj, pobj.actionBody);
break;
case "needClose"://关闭需求
opResult = await this.utilsNeedSve.needClose(pobj, pobj.actionBody);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......
......@@ -35,11 +35,11 @@ class UtilsAuthSve extends AppServiceBase {
* @param {*} pobj
* @param {*} actionBody {channelUserId:XX}
*/
async getUserPinByChannelUserId(pobj, actionBody) {//渠道通过账户进行登录,有则返回用户信息,没有则创建用户---actionBody.channelUserId
async getLoginByUserName(pobj, actionBody) {//渠道通过账户进行登录,有则返回用户信息,没有则创建用户---actionBody.channelUserId
if (!actionBody.channelUserId) {
return system.getResult(null, "actionBody.channelUserId can not be empty");
}
var acckapp = await this.restClient.execPost(pobj, settings.centerAppUrl() + "auth/accessAuth/getUserPinByChannelUserId");
var acckapp = await this.restClient.execPost(pobj, settings.centerAppUrl() + "auth/accessAuth/getLoginByUserName");
var result = acckapp.stdout;
if (result) {
var tmp = JSON.parse(result);
......
var system = require("../../../system");
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
//商标查询操作
class UtilsNeedSve extends AppServiceBase {
constructor() {
super();
this.centerOrderUrl = settings.centerOrderUrl();
}
/**
* 提交需求
* @param {*} pobj
* @param {*} actionBody
*/
async submitNeed(pobj, actionBody) {
if (!actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100380");
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
return await this.restPostUrl(pobj, url);
}
/**
* 获取需求详情
* @param {*} pobj
* @param {*} actionBody needNo 需求号
*/
async getItemByNeedNo(pobj, actionBody) {
if (!actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100380");
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult;
}
/**
* 关闭需求
* @param {*} pobj
* @param {*} actionBody
*/
async needClose(pobj, actionBody) {
if (!actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100380");
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
return await this.restPostUrl(pobj, url);
}
}
module.exports = UtilsNeedSve;
1.获取请求token
1.获取请求token
......@@ -25,11 +25,12 @@ HTTP请求方式 POST
请求方式:POST
请求头中需要有token(token值从接口1中获取)
{
"actionType": "getUserPinByChannelUserId",
"actionType": "getNeedUserPinByChannelUserId",
"actionBody": {
"channelUserId":"xxxxxxxxx",// Y 渠道用户ID
"needNo":"N2020021413152wiWI2e",// Y 需求号
"channelUserId":"15010929366",// Y 渠道用户ID
"channelUserName":"",// N 渠道用户名
"mobile":"", // N 渠道用户手机号
"mobile":"15010929366", // N 渠道用户手机号
"nickName":"", // N 用户昵称
"orgName":"" // N 公司名称
}
......@@ -38,21 +39,49 @@ HTTP请求方式 POST
{
"status": 0,//0成功,否则失败
"msg": "success",
"data": {userpin:"c54abe7249a2a1195d236b333f79"},
"data": {
"userpin":"c54abe7249a2a1195d236b333f79",
"channelTypeCode":"",//阿里公司注册编码:普通公司注册:esp.companyreg、云上公司注册:esp.companyreg_cloud
"typeCode":"gszc"//gszc公司注册,ysgszc云上公司注册
},
"requestId": "2016c54abe7249a2a1195d236b333f79"
}
3.渠道通过账户进行登录,有则返回用户信息,没有则创建用户
地址:[/web/auth/accessAuth/springBoard]
请求方式:POST
请求头中需要有token(token值从接口1中获取)
{
"actionType": "getLoginByUserName",
"actionBody": {
"channelUserId":"15010929366",// Y 渠道用户ID
"channelUserName":"",// N 渠道用户名
"mobile":"15010929366", // N 渠道用户手机号
"nickName":"", // N 用户昵称
"orgName":"" // N 公司名称
}
}
返回结果
{
"status": 0,//0成功,否则失败
"msg": "success",
"data": {
"userpin":"c54abe7249a2a1195d236b333f79"//用户登录后的userpin
},
"requestId": "2016c54abe7249a2a1195d236b333f79"
}
3.查看需求方案列表信息
地址:[/#/needProxy?needNo=XXX&userId=jfklajflsjfs&nickName=松XXX&mobile=15010929368&orgName=汉唐集团]
请求方式:GET
请求头中需要有token(token值从接口1中获取)
地址:[/#/needProxy?needNo=XXX&userId=jfklajflsjfs&nickName=松XXX&mobile=15010929368&orgName=汉唐集团&token=XXXXX]
请求方式:GET
参数说明:
参数说明:
needNo//需求号
userId//用户唯一码
nickName//用户名称
mobile//用户手机号
orgName//公司名称
orgName//公司名称
token//token值
4.推送公司表单材料
......
已经使用的编码汇总:
已经使用的编码汇总:
......@@ -36,3 +36,4 @@
100350
100360
100370
100380
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment