...
|
...
|
@@ -16,16 +16,15 @@ const encryptedUid = uid => crypto.encryption(null, uid + ''); |
|
|
* 新建留言信息
|
|
|
* path: {host}/leavemessage/saveLeavemessage
|
|
|
*
|
|
|
* @param {int} uid 用户id
|
|
|
* @param {int} encryptedUid 加密用户id
|
|
|
* @param {int} conversationId 会话id
|
|
|
* @param {str} content 留言内容
|
|
|
*/
|
|
|
exports.saveMessage = (uid, conversationId, content) => {
|
|
|
exports.saveMessage = (encryptedUid, conversationId, content) => {
|
|
|
let params = {
|
|
|
uid,
|
|
|
conversationId,
|
|
|
content,
|
|
|
encryptedUid: encryptedUid(uid)
|
|
|
encryptedUid
|
|
|
};
|
|
|
|
|
|
|
...
|
...
|
@@ -36,25 +35,24 @@ exports.saveMessage = (uid, conversationId, content) => { |
|
|
|
|
|
/**
|
|
|
* 查询用户聊天记录
|
|
|
* @param {int} uid 用户uid
|
|
|
* @param {string} encryptedUid 加密用户uid
|
|
|
* @param [int] pageSize 每次加载的聊天记录
|
|
|
* @param [int] startTime
|
|
|
* @param [int] endTime
|
|
|
*/
|
|
|
exports.fetchImHistory = (uid, endTime, pageSize, startTime) => {
|
|
|
exports.fetchImHistory = (encryptedUid, endTime, pageSize, startTime) => {
|
|
|
pageSize = pageSize || 10;
|
|
|
|
|
|
let params = {
|
|
|
uid,
|
|
|
pageSize,
|
|
|
encryptedUid: encryptedUid(uid)
|
|
|
encryptedUid
|
|
|
};
|
|
|
|
|
|
_.forEach({startTime, endTime}, (val, key) => {
|
|
|
val && (params[key] = val);
|
|
|
});
|
|
|
|
|
|
return ImService.get('/api/conversationMessage/pageList', params)
|
|
|
return ImService.post('/api/conversationMessage/pageList', params)
|
|
|
.then(result => {
|
|
|
return result;
|
|
|
}, () => {
|
...
|
...
|
@@ -69,13 +67,12 @@ exports.fetchImHistory = (uid, endTime, pageSize, startTime) => { |
|
|
|
|
|
/**
|
|
|
* 获取用户订单, 默认最近10笔
|
|
|
* @param {int} uid 用户uid
|
|
|
* @param {string} encryptedUid 用户加密uid
|
|
|
* @param {init} createTimeBegin 开始时间
|
|
|
*/
|
|
|
exports.fetchOrderList = (uid, createTimeBegin) => {
|
|
|
exports.fetchOrderList = (encryptedUid, createTimeBegin) => {
|
|
|
let params = {
|
|
|
uid,
|
|
|
encryptedUid: encryptedUid(uid),
|
|
|
encryptedUid,
|
|
|
imgSize: '90x120',
|
|
|
};
|
|
|
|
...
|
...
|
@@ -83,7 +80,7 @@ exports.fetchOrderList = (uid, createTimeBegin) => { |
|
|
val && (params[key] = val);
|
|
|
});
|
|
|
|
|
|
return ImService.get('/api/order/queryLastTenOrder', params);
|
|
|
return ImService.post('/api/order/queryLastTenOrder', params);
|
|
|
};
|
|
|
|
|
|
|
...
|
...
|
@@ -97,7 +94,7 @@ exports.fetchOrderList = (uid, createTimeBegin) => { |
|
|
```
|
|
|
### 请求参数说明
|
|
|
| 名称 | 类型 | 是否必须 | 描述 |
|
|
|
| -------------- | ------ | ---- | --------------- |
|
|
|
| -------------- | ------ | ---- | --------------- |
|
|
|
| conversationId | long | Y | 会话id |
|
|
|
| uid | int | Y | 用户ID |
|
|
|
|encryptedUid | String |Y |加密的用户标识 |
|
...
|
...
|
@@ -108,11 +105,10 @@ exports.fetchOrderList = (uid, createTimeBegin) => { |
|
|
| reasonMsg | string | N | 其他原因 |
|
|
|
|
|
|
*/
|
|
|
exports.saveEvalute = (uid, conversationId, promoter, stars, reasonMsg) => {
|
|
|
exports.saveEvalute = (encryptedUid, conversationId, promoter, stars, reasonMsg) => {
|
|
|
let params = {
|
|
|
conversationId,
|
|
|
uid,
|
|
|
encryptedUid: encryptedUid(uid),
|
|
|
encryptedUid,
|
|
|
promoter,
|
|
|
stars,
|
|
|
reasonMsg
|
...
|
...
|
@@ -126,12 +122,12 @@ exports.saveEvalute = (uid, conversationId, promoter, stars, reasonMsg) => { |
|
|
* 获取全球购的订单
|
|
|
*/
|
|
|
|
|
|
exports.queryGlobalOrder = uid => {
|
|
|
exports.queryGlobalOrder = encryptedUid => {
|
|
|
let params = {
|
|
|
uId: uid
|
|
|
encryptedUid
|
|
|
};
|
|
|
|
|
|
return ImService.get('/api/order/queryGlobalOrder', params);
|
|
|
return ImService.post('/api/order/queryGlobalOrder', params);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -143,5 +139,5 @@ exports.queryReasons = cvId => { |
|
|
conversationId: cvId
|
|
|
};
|
|
|
|
|
|
return ImService.get('/api/evalute/queryReasonByConversationId', params);
|
|
|
return ImService.post('/api/evalute/queryReasonByConversationId', params);
|
|
|
}; |
...
|
...
|
|