- 工具栏:面包屑与右侧组件像素级等高(:deep 34px)、合并重复search handler、统一分隔符样式、删除死代码 - 面板对齐:三面板header统一padding/font-size、文件列表分页固定底部(自定义紧凑)、表头默认隐藏、滚动条统一样式 - 预览区:始终显示空白预览面板、重启自动恢复上次打开文件 - 收藏夹:简化计数显示(共N项) - 远程连接:ConnectionIndicator自适应UI(无远程显示mini云图标)、ConnectionDialog支持编辑配置、transport抽象层(本地Wails/远程HTTP双模式)、agent后端模块
42 lines
973 B
Go
42 lines
973 B
Go
package model
|
|
|
|
import "net/http"
|
|
|
|
type Response struct {
|
|
Code int `json:"code"`
|
|
Data interface{} `json:"data,omitempty"`
|
|
Message string `json:"message,omitempty"`
|
|
}
|
|
|
|
func OK(data interface{}) Response {
|
|
return Response{Code: http.StatusOK, Data: data}
|
|
}
|
|
|
|
func Created(data interface{}) Response {
|
|
return Response{Code: http.StatusCreated, Data: data}
|
|
}
|
|
|
|
func NoContent() Response {
|
|
return Response{Code: http.StatusNoContent}
|
|
}
|
|
|
|
func BadRequest(msg string) Response {
|
|
return Response{Code: http.StatusBadRequest, Message: msg}
|
|
}
|
|
|
|
func Unauthorized(msg string) Response {
|
|
return Response{Code: http.StatusUnauthorized, Message: msg}
|
|
}
|
|
|
|
func Forbidden(msg string) Response {
|
|
return Response{Code: http.StatusForbidden, Message: msg}
|
|
}
|
|
|
|
func NotFound(msg string) Response {
|
|
return Response{Code: http.StatusNotFound, Message: msg}
|
|
}
|
|
|
|
func InternalError(msg string) Response {
|
|
return Response{Code: http.StatusInternalServerError, Message: msg}
|
|
}
|