@@ -2,6 +2,8 @@ use std::fmt::Debug;
22use chrono:: NaiveDateTime ;
33use serde:: de:: DeserializeOwned ;
44use serde:: Serialize ;
5+ use serde_json:: Map ;
6+ use serde_json:: Value ;
57use crate :: db:: CommonTask ;
68use crate :: { impl_jsonb_boilerplate, impl_typed_jsonb_boilerplate} ;
79use diesel:: sql_types:: Jsonb ;
@@ -10,6 +12,8 @@ use diesel::pg::Pg;
1012// use diesel::helper_types::IsNull;
1113use std:: io:: Write ;
1214
15+ /// Push notification envelope stored as Jsonb. Domain keys (课程/打卡/计划等) live in [`extra`]
16+ /// so AuthCore stays business-agnostic; flat Json round-trips with legacy rows.
1317#[ derive( AsExpression , FromSqlRow , Debug , Default , Serialize , Deserialize , PartialEq , Clone ) ]
1418#[ diesel( sql_type = Jsonb ) ]
1519pub struct PushInfo {
@@ -19,32 +23,16 @@ pub struct PushInfo {
1923 pub comment_id : Option < String > ,
2024 pub comment_msg : Option < String > ,
2125 pub comment_time : Option < String > ,
22- pub daka_id : Option < String > ,
23- pub end_by : Option < String > ,
24- pub first : Option < String > , // in wx template
2526 pub hty_id2 : Option < String > ,
2627 pub hty_id : Option < String > ,
27- pub jihua_id : Option < String > ,
28- #[ serde( alias = "kecheng_id" ) ]
29- pub clazz_id : Option < String > ,
30- #[ serde( alias = "kecheng_name" ) ]
31- pub clazz_name : Option < String > ,
32- pub lianxi_id : Option < String > ,
3328 pub notify_type : Option < String > ,
34- pub piyue_id : Option < String > ,
35- pub qumu_name : Option < String > ,
36- pub qumu_section_name : Option < String > ,
3729 pub ref_id : Option < String > ,
3830 pub ref_type : Option < String > ,
39- pub reject_reason : Option < String > ,
40- pub remark : Option < String > ,
41- pub resource_note_group_id : Option < String > ,
4231 pub serial : Option < String > ,
43- pub start_from : Option < String > ,
44- pub student_name : Option < String > , // list合并后的所有学生姓名,逗号分隔,发给小程序接口发通知用。
45- pub teacher_name : Option < String > , // list合并后的所有老师姓名,逗号分隔,发给小程序接口发通知用。
4632 pub to_role_id : Option < String > ,
4733 pub from_app_id : Option < String > ,
34+ #[ serde( flatten) ]
35+ pub extra : Map < String , Value > ,
4836}
4937
5038impl_jsonb_boilerplate ! ( PushInfo ) ;
0 commit comments