mycommon_utils/database/common/
ctx.rs1use sea_orm::FromQueryResult;
2use serde::{Deserialize, Serialize};
3use crate::database::BigIntPrimaryKey;
4
5#[derive(Clone, Debug, Default)]
6pub struct ReqContext {
7 pub ori_uri: String,
8 pub path: String,
9 pub path_params: String,
10 pub method: String,
11 pub data: String,
12}
13
14#[derive(Debug, Serialize, Deserialize, Clone)]
15pub struct UserInfoContext {
16 pub store_id: BigIntPrimaryKey,
18 pub user_id: String,
20 pub is_admin: bool,
22 pub is_manager: bool,
24 pub account: String,
26 pub staff_id: String,
28 pub person_id:String,
30}
31
32#[derive(Clone, Debug)]
33pub struct ResInfo {
34 pub duration: String,
35 pub status: String,
36 pub data: String,
37 pub err_msg: String,
38}
39
40#[derive(Clone,Debug, Serialize, Deserialize, FromQueryResult)]
41#[serde(rename_all = "camelCase")]
42pub struct ApiInfo {
43 pub menu_name: String,
44 pub perms: String,
45 pub is_cache: i32,
46}