56 lines
1.1 KiB
Plaintext
56 lines
1.1 KiB
Plaintext
syntax = "v1"
|
|
|
|
import (
|
|
"base.api"
|
|
)
|
|
|
|
type (
|
|
// 机床列表响应
|
|
MachineListReply {
|
|
Id int `json:"id"`
|
|
No int `json:"machineNo"`
|
|
Name string `json:"name"`
|
|
Enabled bool `json:"enabled"`
|
|
}
|
|
|
|
QueryMachinesReq {
|
|
PageReq
|
|
Keyword string `form:"keyword,optional"`
|
|
}
|
|
|
|
MachineReply {
|
|
Id int `json:"id"`
|
|
Name string `json:"name"`
|
|
IpAddress string `json:"ipAddress"`
|
|
Location string `json:"location"`
|
|
Status string `json:"status"`
|
|
Remark string `json:"remark"`
|
|
SlotCount int `json:"slotCount"`
|
|
CreatedAt int64 `json:"createdAt"`
|
|
UpdatedAt int64 `json:"updatedAt"`
|
|
}
|
|
|
|
QueryMachinesReply {
|
|
PageReply
|
|
Data []MachineReply `json:"data"`
|
|
}
|
|
)
|
|
|
|
@server (
|
|
jwt: Auth
|
|
group: machine
|
|
prefix: /api/v1
|
|
)
|
|
service hougai-api {
|
|
@doc "获取机床列表"
|
|
@handler listMachines
|
|
get /machines/list returns ([]MachineListReply)
|
|
|
|
@doc "分页查询机床列表"
|
|
@handler queryMachines
|
|
get /machines (QueryMachinesReq) returns (QueryMachinesReply)
|
|
|
|
@doc "获取机床详情"
|
|
@handler getMachine
|
|
get /machines/:id (PathId) returns (MachineReply)
|
|
} |