Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jiujian
/
client-customer-order-api
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jiaqi Xia
2026-02-04 11:25:09 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0ea687900900e911b33191b5d77a2f47a8aaeb16
0ea68790
1 parent
dc9adbf4
feat: 微信点餐推送
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
350 additions
and
27 deletions
src/main/java/com/infoloop/tianting/constant/ConfigConstants.java
src/main/java/com/infoloop/tianting/logic/task/OrderReminderTask.java
src/main/java/com/infoloop/tianting/logic/task/OrderReminderTaskRunner.java
src/main/java/com/infoloop/tianting/service/OrderReminderService.java
src/main/java/com/infoloop/tianting/service/client/MealOrderServiceRpcClient.java
src/main/java/com/infoloop/tianting/service/client/WxOfficialAccountHttpClient.java
src/main/java/com/infoloop/tianting/service/impl/OrderReminderServiceImpl.java
src/main/proto/MealOrderService.proto
src/main/java/com/infoloop/tianting/constant/ConfigConstants.java
View file @
0ea6879
...
...
@@ -83,4 +83,9 @@ public interface ConfigConstants {
String
MINI_PROGRAM_APP_SECRET
=
"${miniprogram.appSecret}"
;
String
MINI_PROGRAM_ORDER_REMINDER_TEMPLATE_ID
=
"${miniprogram.orderReminderTemplateId}"
;
// 公众号配置(用于订阅消息推送)
String
OFFICIAL_ACCOUNT_APP_ID
=
"${officialAccount.appId}"
;
String
OFFICIAL_ACCOUNT_APP_SECRET
=
"${officialAccount.appSecret}"
;
String
OFFICIAL_ACCOUNT_ORDER_REMINDER_TEMPLATE_ID
=
"${officialAccount.orderReminderTemplateId}"
;
}
...
...
src/main/java/com/infoloop/tianting/logic/task/OrderReminderTask.java
0 → 100644
View file @
0ea6879
This diff is collapsed. Click to expand it.
src/main/java/com/infoloop/tianting/logic/task/OrderReminderTaskRunner.java
0 → 100644
View file @
0ea6879
package
com
.
infoloop
.
tianting
.
logic
.
task
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.stereotype.Component
;
import
java.util.Arrays
;
/**
* 订餐提醒任务命令行执行器
* 通过命令行参数 --trigger-order-reminder 触发执行
*
* 使用方式:
* java -jar app.jar --trigger-order-reminder
* 或者
* java -jar app.jar --spring.main.web-application-type=none --trigger-order-reminder
*/
@Slf4j
@Component
@RequiredArgsConstructor
public
class
OrderReminderTaskRunner
implements
CommandLineRunner
{
private
final
OrderReminderTask
orderReminderTask
;
@Override
public
void
run
(
String
...
args
)
{
boolean
shouldTrigger
=
Arrays
.
asList
(
args
).
contains
(
"--trigger-order-reminder"
);
if
(
shouldTrigger
)
{
log
.
info
(
"OrderReminderTaskRunner: Triggering order reminder task via command line"
);
orderReminderTask
.
executeTask
();
log
.
info
(
"OrderReminderTaskRunner: Task execution completed"
);
}
}
}
src/main/java/com/infoloop/tianting/service/OrderReminderService.java
View file @
0ea6879
...
...
@@ -4,19 +4,24 @@ import com.infoloop.tianting.model.dto.WxUserDto.SendSubscriptionMessageResponse
/**
* 订餐提醒服务接口
* 用于发送订餐周期开启前的提醒消息
* 用于发送订餐周期开启前的提醒消息
(小程序订阅消息)
*/
public
interface
OrderReminderService
{
/**
* 发送订餐提醒消息
*
* @param openId 用户 OpenID
* @param page 点击跳转页面路径,例如:pages/order/index?cycleId=202501
* @param reminderContent 提醒内容,例如:"下次订餐即将开启"
* @param orderTime 订餐时间,例如:"周一 09:00 至 周三 12:00"
* @param tips 温馨提示,例如:"请点击卡片,准时进入小程序完成预订"
* 小程序模板字段(模板ID: BCROwaS_oj1_b0fzc_qrgvtSeCtfxctghcLMu-Obkfw):
* - thing8: 用餐类型(如:下次订单即将开始)
* - time1: 订餐时间(如:13:00~21:00)
* - thing2: 温馨提示(如:为了保证您明日正常用餐,立即订餐!)
*
* @param openId 用户 OpenID(小程序的 openId)
* @param page 点击跳转小程序页面路径
* @param mealType 用餐类型,例如:"下次订单即将开始"
* @param orderTime 订餐时间,例如:"13:00~21:00"
* @param tips 温馨提示,例如:"为了保证您明日正常用餐,立即订餐!"
* @return 发送结果
*/
SendSubscriptionMessageResponse
sendOrderReminder
(
String
openId
,
String
page
,
String
reminderContent
,
String
orderTime
,
String
tips
);
String
mealType
,
String
orderTime
,
String
tips
);
}
...
...
src/main/java/com/infoloop/tianting/service/client/MealOrderServiceRpcClient.java
View file @
0ea6879
...
...
@@ -12,8 +12,13 @@ import com.infoloop.tianting.mealorderservice.CreateMpAccountDinerRefRpcRequest;
import
com.infoloop.tianting.mealorderservice.CreateMpAccountDinerRefRpcResponse
;
import
com.infoloop.tianting.mealorderservice.CreateMpAccountRpcRequest
;
import
com.infoloop.tianting.mealorderservice.CreateMpAccountRpcResponse
;
import
com.infoloop.tianting.mealorderservice.BatchDeleteOrderSubscriptionMessagesByIdsRpcRequest
;
import
com.infoloop.tianting.mealorderservice.CreateOrderSubscriptionMessageRpcRequest
;
import
com.infoloop.tianting.mealorderservice.DeleteDinersByIdsRpcRequest
;
import
com.infoloop.tianting.mealorderservice.GetUserOrderSubscriptionMessageHistoryRpcRequest
;
import
com.infoloop.tianting.mealorderservice.OrderSubscriptionMessageRpcResponse
;
import
com.infoloop.tianting.mealorderservice.PendingOrderSubscriptionMessageRpcResponse
;
import
com.infoloop.tianting.mealorderservice.QueryPendingOrderSubscriptionMessagesRpcRequest
;
import
com.infoloop.tianting.mealorderservice.DeleteMpAccountDinerRefsByIdsRpcRequest
;
import
com.infoloop.tianting.mealorderservice.DinerCreation
;
import
com.infoloop.tianting.mealorderservice.DinerModification
;
...
...
@@ -37,6 +42,7 @@ import com.infoloop.tianting.mealorderservice.QueryGradeClassesByConditionRpcReq
import
com.infoloop.tianting.mealorderservice.QueryLatestMealMenuRecordsByClientIdsRpcRequest
;
import
com.infoloop.tianting.mealorderservice.QueryMealOrdersByConditionRpcRequest
;
import
com.infoloop.tianting.mealorderservice.QueryMpAccountDinerRefsByConditionRpcRequest
;
import
com.infoloop.tianting.mealorderservice.QueryMpAccountsByConditionRpcRequest
;
import
com.infoloop.tianting.mealorderservice.QueryReserveMealOrdersByDinerIdsRpcRequest
;
import
com.infoloop.tianting.mealorderservice.SingleDinerRpcResponse
;
import
com.infoloop.tianting.mealorderservice.SingleGradeClassRpcResponse
;
...
...
@@ -105,6 +111,19 @@ public class MealOrderServiceRpcClient {
.
build
());
}
/**
* 查询所有活跃的小程序用户
*/
public
List
<
SingleMpAccountRpcResponse
>
queryAllActiveMpAccounts
(
int
enterpriseId
)
{
return
mealOrderServiceRpcBlockingStub
.
queryMpAccountsByCondition
(
QueryMpAccountsByConditionRpcRequest
.
newBuilder
()
.
setEnterpriseId
(
enterpriseId
)
.
setShouldFilterStatus
(
false
)
.
setIncludeDeleted
(
false
)
.
build
()
).
getResponsesList
();
}
public
List
<
SingleMpAccountDinerRefRpcResponse
>
queryMpAccountDinerRefsByCondition
(
int
enterpriseId
,
List
<
Integer
>
mpAccountIds
,
List
<
Integer
>
dinerIds
)
{
return
mealOrderServiceRpcBlockingStub
.
queryMpAccountDinerRefsByCondition
(
QueryMpAccountDinerRefsByConditionRpcRequest
.
newBuilder
()
.
setEnterpriseId
(
enterpriseId
)
...
...
@@ -328,4 +347,48 @@ public class MealOrderServiceRpcClient {
}
return
mealOrderServiceRpcBlockingStub
.
createOrderSubscriptionMessage
(
req
.
build
()).
getId
();
}
/**
* 查询用户订阅消息历史(未删除的记录)
*/
public
List
<
OrderSubscriptionMessageRpcResponse
>
getUserOrderSubscriptionMessageHistory
(
int
enterpriseId
,
String
openId
,
@Nullable
Long
orderPeriodStartDate
)
{
final
var
reqBuilder
=
GetUserOrderSubscriptionMessageHistoryRpcRequest
.
newBuilder
()
.
setEnterpriseId
(
enterpriseId
)
.
setOpenId
(
openId
);
if
(
orderPeriodStartDate
!=
null
)
{
reqBuilder
.
setOrderPeriodStartDate
(
orderPeriodStartDate
);
}
return
mealOrderServiceRpcBlockingStub
.
getUserOrderSubscriptionMessageHistory
(
reqBuilder
.
build
())
.
getResponseList
();
}
/**
* 批量删除订阅消息(逻辑删除,发送成功后调用)
*/
public
int
batchDeleteOrderSubscriptionMessagesByIds
(
int
enterpriseId
,
List
<
Long
>
ids
)
{
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
0
;
}
return
mealOrderServiceRpcBlockingStub
.
batchDeleteOrderSubscriptionMessagesByIds
(
BatchDeleteOrderSubscriptionMessagesByIdsRpcRequest
.
newBuilder
()
.
setEnterpriseId
(
enterpriseId
)
.
addAllIds
(
ids
)
.
build
()
).
getAffectedRows
();
}
/**
* 查询待发送的订阅消息(未删除的记录)
*/
public
List
<
PendingOrderSubscriptionMessageRpcResponse
>
queryPendingOrderSubscriptionMessages
(
int
enterpriseId
)
{
return
mealOrderServiceRpcBlockingStub
.
queryPendingOrderSubscriptionMessages
(
QueryPendingOrderSubscriptionMessagesRpcRequest
.
newBuilder
()
.
setEnterpriseId
(
enterpriseId
)
.
build
()
).
getResponsesList
();
}
}
...
...
src/main/java/com/infoloop/tianting/service/client/WxOfficialAccountHttpClient.java
0 → 100644
View file @
0ea6879
package
com
.
infoloop
.
tianting
.
service
.
client
;
import
com.infoloop.tianting.model.dto.WxUserDto.SendSubscriptionMessageResponse
;
import
com.infoloop.tianting.model.dto.WxUserDto.WxUserTokenDto
;
import
com.infoloop.tianting.utils.JsonUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
static
com
.
infoloop
.
tianting
.
constant
.
ConfigConstants
.
OFFICIAL_ACCOUNT_APP_ID
;
import
static
com
.
infoloop
.
tianting
.
constant
.
ConfigConstants
.
OFFICIAL_ACCOUNT_APP_SECRET
;
/**
* 微信公众号 HTTP 客户端
* 用于发送公众号一次性订阅消息
*/
@Slf4j
@Service
@RequiredArgsConstructor
(
onConstructor
=
@__
(
@Autowired
))
public
class
WxOfficialAccountHttpClient
{
/**
* 公众号一次性订阅消息接口
* 文档:https://developers.weixin.qq.com/doc/offiaccount/Message_Management/One-time_subscription_info.html
*/
private
static
final
String
SUBSCRIBE_MESSAGE_URL
=
"https://api.weixin.qq.com/cgi-bin/message/template/subscribe?access_token={accessToken}"
;
private
static
final
String
ACCESS_TOKEN_CACHE_KEY
=
"wx:official_account:access_token"
;
private
final
RestTemplate
restTemplate
;
private
final
StringRedisTemplate
stringRedisTemplate
;
@Value
(
OFFICIAL_ACCOUNT_APP_ID
)
private
String
appId
;
@Value
(
OFFICIAL_ACCOUNT_APP_SECRET
)
private
String
appSecret
;
private
final
Object
lock
=
new
Object
();
/**
* 获取公众号 access_token(带缓存)
*/
public
String
fetchStableAccessToken
()
{
log
.
info
(
"Fetching Official Account access token..."
);
String
cachedToken
=
stringRedisTemplate
.
opsForValue
().
get
(
ACCESS_TOKEN_CACHE_KEY
);
if
(
StringUtils
.
isNotEmpty
(
cachedToken
))
{
log
.
info
(
"Using cached Official Account access token"
);
return
cachedToken
;
}
synchronized
(
lock
)
{
cachedToken
=
stringRedisTemplate
.
opsForValue
().
get
(
ACCESS_TOKEN_CACHE_KEY
);
if
(
StringUtils
.
isNotEmpty
(
cachedToken
))
{
log
.
info
(
"Using cached Official Account access token after lock"
);
return
cachedToken
;
}
String
url
=
"https://api.weixin.qq.com/cgi-bin/stable_token"
;
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
Map
<
String
,
String
>
requestBody
=
new
HashMap
<>();
requestBody
.
put
(
"grant_type"
,
"client_credential"
);
requestBody
.
put
(
"appid"
,
appId
);
requestBody
.
put
(
"secret"
,
appSecret
);
HttpEntity
<
Map
<
String
,
String
>>
request
=
new
HttpEntity
<>(
requestBody
,
headers
);
ResponseEntity
<
String
>
response
=
restTemplate
.
postForEntity
(
url
,
request
,
String
.
class
);
if
(!
response
.
getStatusCode
().
is2xxSuccessful
()
||
response
.
getBody
()
==
null
)
{
log
.
error
(
"Failed to fetch Official Account access token: {}"
,
response
);
throw
new
IllegalArgumentException
(
"获取公众号 access_token 失败"
);
}
WxUserTokenDto
tokenDto
=
JsonUtil
.
readJsonAs
(
response
.
getBody
(),
WxUserTokenDto
.
class
);
log
.
info
(
"Official Account access token received, expires_in: {}"
,
tokenDto
.
getExpires_in
());
String
accessToken
=
tokenDto
.
getAccess_token
();
// 缓存 token,提前 5 分钟过期
long
expireSeconds
=
tokenDto
.
getExpires_in
()
-
300
;
if
(
expireSeconds
>
0
)
{
stringRedisTemplate
.
opsForValue
().
set
(
ACCESS_TOKEN_CACHE_KEY
,
accessToken
,
expireSeconds
,
TimeUnit
.
SECONDS
);
}
return
accessToken
;
}
}
/**
* 发送公众号一次性订阅消息
*
* @param openId 用户在公众号下的 OpenID
* @param templateId 公众号订阅消息模板 ID
* @param scene 订阅场景值(用户授权时传入的 scene)
* @param title 消息标题(15字以内)
* @param data 模板数据,格式为 Map<String, Map<String, String>>
* @param url 点击跳转的 URL(可选)
* @param miniprogram 跳转小程序配置(可选)
* @return 发送结果
*/
public
SendSubscriptionMessageResponse
sendSubscriptionMessage
(
String
openId
,
String
templateId
,
String
scene
,
String
title
,
Map
<
String
,
Object
>
data
,
String
url
,
Map
<
String
,
String
>
miniprogram
)
{
try
{
String
accessToken
=
fetchStableAccessToken
();
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
Map
<
String
,
Object
>
requestBody
=
new
HashMap
<>();
requestBody
.
put
(
"touser"
,
openId
);
requestBody
.
put
(
"template_id"
,
templateId
);
requestBody
.
put
(
"scene"
,
scene
);
requestBody
.
put
(
"title"
,
title
);
requestBody
.
put
(
"data"
,
data
);
if
(
StringUtils
.
isNotEmpty
(
url
))
{
requestBody
.
put
(
"url"
,
url
);
}
if
(
miniprogram
!=
null
&&
!
miniprogram
.
isEmpty
())
{
requestBody
.
put
(
"miniprogram"
,
miniprogram
);
}
HttpEntity
<
Map
<
String
,
Object
>>
requestEntity
=
new
HttpEntity
<>(
requestBody
,
headers
);
ResponseEntity
<
SendSubscriptionMessageResponse
>
response
=
restTemplate
.
postForEntity
(
SUBSCRIBE_MESSAGE_URL
,
requestEntity
,
SendSubscriptionMessageResponse
.
class
,
accessToken
);
if
(!
response
.
getStatusCode
().
is2xxSuccessful
()
||
response
.
getBody
()
==
null
)
{
log
.
error
(
"Failed to send Official Account subscription message: {}"
,
response
);
throw
new
IllegalArgumentException
(
"发送公众号订阅消息失败"
);
}
SendSubscriptionMessageResponse
result
=
response
.
getBody
();
if
(
result
.
getErrcode
()
!=
null
&&
result
.
getErrcode
()
!=
0
)
{
log
.
error
(
"Official Account subscription message error: errcode={}, errmsg={}"
,
result
.
getErrcode
(),
result
.
getErrmsg
());
}
else
{
log
.
info
(
"Official Account subscription message sent successfully to openId: {}"
,
openId
);
}
return
result
;
}
catch
(
Exception
e
)
{
log
.
error
(
"Error sending Official Account subscription message to openId: {}"
,
openId
,
e
);
throw
new
IllegalArgumentException
(
"发送公众号订阅消息失败: "
+
e
.
getMessage
());
}
}
/**
* 发送公众号一次性订阅消息(简化版,跳转到小程序)
*/
public
SendSubscriptionMessageResponse
sendSubscriptionMessageToMiniProgram
(
String
openId
,
String
templateId
,
String
scene
,
String
title
,
Map
<
String
,
Object
>
data
,
String
miniProgramAppId
,
String
miniProgramPagePath
)
{
Map
<
String
,
String
>
miniprogram
=
new
HashMap
<>();
miniprogram
.
put
(
"appid"
,
miniProgramAppId
);
miniprogram
.
put
(
"pagepath"
,
miniProgramPagePath
);
return
sendSubscriptionMessage
(
openId
,
templateId
,
scene
,
title
,
data
,
null
,
miniprogram
);
}
}
src/main/java/com/infoloop/tianting/service/impl/OrderReminderServiceImpl.java
View file @
0ea6879
...
...
@@ -16,7 +16,16 @@ import static com.infoloop.tianting.constant.ConfigConstants.MINI_PROGRAM_ORDER_
/**
* 订餐提醒服务实现
* 将业务参数转换为微信订阅消息模板格式并发送
* 使用小程序订阅消息接口发送提醒
*
* 小程序模板字段(模板ID: BCROwaS_oj1_b0fzc_qrgvtSeCtfxctghcLMu-Obkfw):
* - thing8: 用餐类型(如:下次订单即将开始)
* - time1: 订餐时间(如:13:00~21:00)
* - thing2: 温馨提示(如:为了保证您明日正常用餐,立即订餐!)
*
* 注意:
* 1. 使用的是小程序的 access_token 和 template_id
* 2. openId 是用户在小程序下的 openId
*/
@Slf4j
@Service
...
...
@@ -31,36 +40,41 @@ public class OrderReminderServiceImpl implements OrderReminderService {
@Override
public
SendSubscriptionMessageResponse
sendOrderReminder
(
String
openId
,
String
page
,
String
reminderContent
,
String
mealType
,
String
orderTime
,
String
tips
)
{
log
.
info
(
"Sending order reminder to openId: {}, page: {}"
,
openId
,
page
);
log
.
info
(
"Sending order reminder via MiniProgram to openId: {}, page: {}, mealType: {}, orderTime: {}, tips: {}"
,
openId
,
page
,
mealType
,
orderTime
,
tips
);
// 将业务参数转换为微信模板数据格式
// 根据文档,模板字段为:thing1 (提醒内容), time2 (订餐时间), thing3 (温馨提示)
// 构建小程序订阅消息模板数据
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
// thing
1: 提醒内容
Map
<
String
,
String
>
thing
1
Value
=
new
HashMap
<>();
thing
1Value
.
put
(
"value"
,
reminderContent
);
data
.
put
(
"thing
1"
,
thing1
Value
);
// thing
8: 用餐类型(如:下次订单即将开始)
Map
<
String
,
String
>
thing
8
Value
=
new
HashMap
<>();
thing
8Value
.
put
(
"value"
,
mealType
);
data
.
put
(
"thing
8"
,
thing8
Value
);
// time
2: 订餐时间
Map
<
String
,
String
>
time
2
Value
=
new
HashMap
<>();
time
2
Value
.
put
(
"value"
,
orderTime
);
data
.
put
(
"time
2"
,
time2
Value
);
// time
1: 订餐时间(如:13:00~21:00)
Map
<
String
,
String
>
time
1
Value
=
new
HashMap
<>();
time
1
Value
.
put
(
"value"
,
orderTime
);
data
.
put
(
"time
1"
,
time1
Value
);
// thing
3
: 温馨提示
Map
<
String
,
String
>
thing
3
Value
=
new
HashMap
<>();
thing
3
Value
.
put
(
"value"
,
tips
);
data
.
put
(
"thing
3"
,
thing3
Value
);
// thing
2
: 温馨提示
Map
<
String
,
String
>
thing
2
Value
=
new
HashMap
<>();
thing
2
Value
.
put
(
"value"
,
tips
);
data
.
put
(
"thing
2"
,
thing2
Value
);
try
{
// 使用小程序订阅消息接口
SendSubscriptionMessageResponse
response
=
wxMiniProgramService
.
sendSubscriptionMessage
(
openId
,
templateId
,
page
,
data
);
openId
,
templateId
,
page
,
data
);
if
(
response
.
getErrcode
()
!=
null
&&
response
.
getErrcode
()
==
0
)
{
log
.
info
(
"Order reminder sent successfully to openId: {}"
,
openId
);
log
.
info
(
"Order reminder sent successfully
via MiniProgram
to openId: {}"
,
openId
);
}
else
{
log
.
warn
(
"Order reminder sent with error. openId: {}, errcode: {}, errmsg: {}"
,
openId
,
response
.
getErrcode
(),
response
.
getErrmsg
());
...
...
@@ -68,7 +82,7 @@ public class OrderReminderServiceImpl implements OrderReminderService {
return
response
;
}
catch
(
Exception
e
)
{
log
.
error
(
"Failed to send order reminder to openId: {}"
,
openId
,
e
);
log
.
error
(
"Failed to send order reminder
via MiniProgram
to openId: {}"
,
openId
,
e
);
throw
e
;
}
}
...
...
src/main/proto/MealOrderService.proto
View file @
0ea6879
...
...
@@ -69,6 +69,7 @@ service MealOrderServiceRpc {
rpc
GetUserOrderSubscriptionMessageHistory
(
GetUserOrderSubscriptionMessageHistoryRpcRequest
)
returns
(
GetUserOrderSubscriptionMessageHistoryRpcResponse
)
{}
rpc
BatchDeleteOrderSubscriptionMessagesByIds
(
BatchDeleteOrderSubscriptionMessagesByIdsRpcRequest
)
returns
(
BatchDeleteOrderSubscriptionMessagesByIdsRpcResponse
)
{}
rpc
BatchPhysicalDeleteOrderSubscriptionMessagesByIds
(
BatchPhysicalDeleteOrderSubscriptionMessagesByIdsRpcRequest
)
returns
(
BatchPhysicalDeleteOrderSubscriptionMessagesByIdsRpcResponse
)
{}
rpc
QueryPendingOrderSubscriptionMessages
(
QueryPendingOrderSubscriptionMessagesRpcRequest
)
returns
(
QueryPendingOrderSubscriptionMessagesRpcResponse
)
{}
}
enum
MealOrderOrderMethodEnum
{
...
...
@@ -1013,3 +1014,24 @@ message BatchPhysicalDeleteOrderSubscriptionMessagesByIdsRpcRequest {
message
BatchPhysicalDeleteOrderSubscriptionMessagesByIdsRpcResponse
{
int32
affectedRows
=
1
;
// 受影响的行数
}
// 查询待发送的订阅消息(未删除的记录)
message
QueryPendingOrderSubscriptionMessagesRpcRequest
{
int32
enterpriseId
=
1
;
}
message
PendingOrderSubscriptionMessageRpcResponse
{
int64
id
=
1
;
int32
enterpriseId
=
2
;
int32
dinerId
=
3
;
string
openId
=
4
;
string
templateId
=
5
;
int64
orderPeriodStartDate
=
6
;
string
jumpPath
=
7
;
int64
orderPeriodEndDate
=
8
;
int64
createdAt
=
9
;
}
message
QueryPendingOrderSubscriptionMessagesRpcResponse
{
repeated
PendingOrderSubscriptionMessageRpcResponse
responses
=
1
;
}
...
...
Please
register
or
login
to post a comment