Skip to main content

mycommon_utils/database/common/
ctx.rs

1use 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    // 账号归属
17    pub store_id: BigIntPrimaryKey,
18    // 用户ID
19    pub user_id: String,
20    //是否为admin
21    pub is_admin: bool,
22    //是否管理员
23    pub is_manager: bool,
24    //账号名称
25    pub account: String,
26    //员工ID
27    pub staff_id: String,
28    //人员ID
29    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}