1 Star 9 Fork 4

dot2/tutorial

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
controller.rs 519 Bytes
一键复制 编辑 原始数据 按行查看 历史
刘荣飞 提交于 2020-12-17 20:48 +08:00 . 添加了插入分类
use serde::{Serialize, Deserialize};
pub mod admin;
pub mod front;
#[derive(Serialize, Debug, Deserialize)]
pub struct Res<T> {
pub errno: i32,
pub msg: String,
pub data: Option<T>,
}
impl<T> Res<T> {
pub fn new_with_error(errno: i32, msg: String) -> Res<T> {
Res {
errno,
msg,
data: None,
}
}
pub fn new(data: Option<T>) -> Res<T> {
Res {
errno: 0,
msg: "".to_string(),
data,
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Rust
1
https://gitee.com/dot2/tutorial.git
git@gitee.com:dot2/tutorial.git
dot2
tutorial
tutorial
master

搜索帮助