mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2026-02-16 19:20:56 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ad7a0ff41 | ||
|
|
737fe749de | ||
|
|
b9c6f17e3f | ||
|
|
af6a340003 | ||
|
|
8ba3bee944 | ||
|
|
153c3566b6 | ||
|
|
97a4753f4f | ||
|
|
74c3899b55 |
@@ -1,8 +1,11 @@
|
|||||||
# Ignore Docker Compose configuration files
|
# Ignore Docker Compose configuration files
|
||||||
docker-compose.yaml
|
docker-compose.yaml
|
||||||
|
docker-compose-dev.yaml
|
||||||
|
|
||||||
# Ignore development Dockerfile
|
# Ignore development Dockerfile
|
||||||
|
Dockerfile
|
||||||
Dockerfile.dev
|
Dockerfile.dev
|
||||||
|
docker-dev.sh
|
||||||
|
|
||||||
# Ignore the data directory
|
# Ignore the data directory
|
||||||
data/
|
data/
|
||||||
|
|||||||
@@ -12,17 +12,19 @@ WORKDIR /app
|
|||||||
# Step 1: Copy the source code
|
# Step 1: Copy the source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# use --mount=type=cache,target=/go/pkg/mod to cache the go mod
|
||||||
# Step 2: Download dependencies
|
# Step 2: Download dependencies
|
||||||
RUN go mod tidy && go mod download
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||||
|
go mod tidy && go mod download && go install github.com/swaggo/swag/cmd/swag@latest
|
||||||
|
|
||||||
|
# Step 3: Run swag build script
|
||||||
# Step 3: Install swag and Run the build script
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||||
RUN go install github.com/swaggo/swag/cmd/swag@latest && \
|
|
||||||
swag init -g cmd/apimain.go --output docs/api --instanceName api --exclude http/controller/admin && \
|
swag init -g cmd/apimain.go --output docs/api --instanceName api --exclude http/controller/admin && \
|
||||||
swag init -g cmd/apimain.go --output docs/admin --instanceName admin --exclude http/controller/api
|
swag init -g cmd/apimain.go --output docs/admin --instanceName admin --exclude http/controller/api
|
||||||
|
|
||||||
# Build the Go application with CGO enabled and specified ldflags
|
# Step 4: Build the Go application with CGO enabled and specified ldflags
|
||||||
RUN CGO_ENABLED=1 GOOS=linux go build -a \
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||||
|
CGO_ENABLED=1 GOOS=linux go build -a \
|
||||||
-ldflags "-s -w --extldflags '-static -fpic'" \
|
-ldflags "-s -w --extldflags '-static -fpic'" \
|
||||||
-installsuffix cgo -o release/apimain cmd/apimain.go
|
-installsuffix cgo -o release/apimain cmd/apimain.go
|
||||||
|
|
||||||
@@ -32,13 +34,24 @@ FROM node:18-alpine AS builder-admin-frontend
|
|||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /frontend
|
WORKDIR /frontend
|
||||||
|
|
||||||
RUN apk update && apk add git --no-cache
|
ARG COUNTRY
|
||||||
|
# Install required tools without caching index to minimize image size
|
||||||
|
RUN if [ "$COUNTRY" = "CN" ] ; then \
|
||||||
|
echo "It is in China, updating the repositories"; \
|
||||||
|
sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories; \
|
||||||
|
fi && \
|
||||||
|
apk update && apk add --no-cache git
|
||||||
|
|
||||||
# Clone the frontend repository
|
# Clone the frontend repository
|
||||||
RUN git clone https://github.com/lejianwen/rustdesk-api-web .
|
RUN git clone https://github.com/lejianwen/rustdesk-api-web .
|
||||||
|
|
||||||
# Install npm dependencies and build the frontend
|
# Install required tools without caching index to minimize image size
|
||||||
RUN npm install && npm run build
|
RUN if [ "$COUNTRY" = "CN" ] ; then \
|
||||||
|
echo "It is in China, updating NPM_CONFIG_REGISTRY"; \
|
||||||
|
export NPM_CONFIG_REGISTRY="https://mirrors.huaweicloud.com/repository/npm/"; \
|
||||||
|
fi && \
|
||||||
|
npm install && npm run build
|
||||||
|
|
||||||
|
|
||||||
# Stage 2: Final Image
|
# Stage 2: Final Image
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
@@ -47,7 +60,13 @@ FROM alpine:latest
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install necessary runtime dependencies
|
# Install necessary runtime dependencies
|
||||||
RUN apk add --no-cache tzdata file
|
# Install required tools without caching index to minimize image size
|
||||||
|
ARG COUNTRY
|
||||||
|
RUN if [ "$COUNTRY" = "CN" ] ; then \
|
||||||
|
echo "It is in China, updating the repositories"; \
|
||||||
|
sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories; \
|
||||||
|
fi && \
|
||||||
|
apk update && apk add --no-cache tzdata file
|
||||||
|
|
||||||
# Copy the built application and resources from the builder stage
|
# Copy the built application and resources from the builder stage
|
||||||
COPY --from=builder-backend /app/release /app/
|
COPY --from=builder-backend /app/release /app/
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ rustdesk:
|
|||||||
id-server: "192.168.1.66:21116"
|
id-server: "192.168.1.66:21116"
|
||||||
relay-server: "192.168.1.66:21117"
|
relay-server: "192.168.1.66:21117"
|
||||||
api-server: "http://127.0.0.1:21114"
|
api-server: "http://127.0.0.1:21114"
|
||||||
key: "123456789"
|
key: ""
|
||||||
|
key-file: "./conf/data/id_ed25519.pub"
|
||||||
personal: 1
|
personal: 1
|
||||||
logger:
|
logger:
|
||||||
path: "./runtime/log.txt"
|
path: "./runtime/log.txt"
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ func Init(rowVal interface{}) *viper.Viper {
|
|||||||
if err := v.Unmarshal(rowVal); err != nil {
|
if err := v.Unmarshal(rowVal); err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
|
LoadKeyFile(&rowVal.(*Config).Rustdesk)
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,30 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
type Rustdesk struct {
|
type Rustdesk struct {
|
||||||
IdServer string `mapstructure:"id-server"`
|
IdServer string `mapstructure:"id-server"`
|
||||||
RelayServer string `mapstructure:"relay-server"`
|
RelayServer string `mapstructure:"relay-server"`
|
||||||
ApiServer string `mapstructure:"api-server"`
|
ApiServer string `mapstructure:"api-server"`
|
||||||
Key string `mapstructure:"key"`
|
Key string `mapstructure:"key"`
|
||||||
|
KeyFile string `mapstructure:"key-file"`
|
||||||
Personal int `mapstructure:"personal"`
|
Personal int `mapstructure:"personal"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func LoadKeyFile(rustdesk *Rustdesk) {
|
||||||
|
// Load key file
|
||||||
|
if rustdesk.Key != "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if rustdesk.KeyFile != "" {
|
||||||
|
// Load key from file
|
||||||
|
b, err := os.ReadFile(rustdesk.KeyFile)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
rustdesk.Key = string(b)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile.dev
|
dockerfile: Dockerfile.dev
|
||||||
|
args:
|
||||||
|
COUNTRY: CN
|
||||||
# image: lejianwen/rustdesk-api
|
# image: lejianwen/rustdesk-api
|
||||||
container_name: rustdesk-api
|
container_name: rustdesk-api
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
35
docker-dev.sh
Executable file
35
docker-dev.sh
Executable file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Define Docker Compose file and cache option
|
||||||
|
COMPOSE_FILE_NAME="docker-compose-dev.yaml"
|
||||||
|
CACHE=""
|
||||||
|
# Uncomment the next line to enable no-cache option
|
||||||
|
# CACHE="--no-cache"
|
||||||
|
|
||||||
|
# Define the base Docker Compose command
|
||||||
|
DCS="docker compose -f ${COMPOSE_FILE_NAME}"
|
||||||
|
|
||||||
|
# Function to build and start services
|
||||||
|
build_and_run() {
|
||||||
|
echo "Building services..."
|
||||||
|
if ! $DCS build ${CACHE}; then
|
||||||
|
echo "Error: Failed to build services"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Starting services..."
|
||||||
|
if ! $DCS up -d; then
|
||||||
|
echo "Error: Failed to start services"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Services started successfully"
|
||||||
|
echo "If you want to stop the services, run"
|
||||||
|
echo "docker compose -f ${COMPOSE_FILE_NAME} down"
|
||||||
|
|
||||||
|
echo "If you want to see the logs, run"
|
||||||
|
echo "docker compose -f ${COMPOSE_FILE_NAME} logs -f"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Execute build and start function
|
||||||
|
build_and_run
|
||||||
@@ -353,17 +353,20 @@ const docTemplateadmin = `{
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "创建地址簿集合",
|
"description": "创建地址簿名称",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "创建地址簿集合",
|
"tags": [
|
||||||
|
"地址簿名称"
|
||||||
|
],
|
||||||
|
"summary": "创建地址簿名称",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "地址簿集合信息",
|
"description": "地址簿名称信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -407,17 +410,20 @@ const docTemplateadmin = `{
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合删除",
|
"description": "地址簿名称删除",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合删除",
|
"tags": [
|
||||||
|
"地址簿名称"
|
||||||
|
],
|
||||||
|
"summary": "地址簿名称删除",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "地址簿集合信息",
|
"description": "地址簿名称信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -449,14 +455,17 @@ const docTemplateadmin = `{
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合详情",
|
"description": "地址簿名称详情",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合详情",
|
"tags": [
|
||||||
|
"地址簿名称"
|
||||||
|
],
|
||||||
|
"summary": "地址簿名称详情",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@@ -501,14 +510,17 @@ const docTemplateadmin = `{
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合列表",
|
"description": "地址簿名称列表",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合列表",
|
"tags": [
|
||||||
|
"地址簿名称"
|
||||||
|
],
|
||||||
|
"summary": "地址簿名称列表",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@@ -570,17 +582,20 @@ const docTemplateadmin = `{
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合编辑",
|
"description": "地址簿名称编辑",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合编辑",
|
"tags": [
|
||||||
|
"地址簿名称"
|
||||||
|
],
|
||||||
|
"summary": "地址簿名称编辑",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "地址簿集合信息",
|
"description": "地址簿名称信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -624,17 +639,20 @@ const docTemplateadmin = `{
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "创建地址簿集合规则",
|
"description": "创建地址簿规则",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "创建地址簿集合规则",
|
"tags": [
|
||||||
|
"地址簿规则"
|
||||||
|
],
|
||||||
|
"summary": "创建地址簿规则",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "地址簿集合规则信息",
|
"description": "地址簿规则信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -678,17 +696,20 @@ const docTemplateadmin = `{
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合规则删除",
|
"description": "地址簿规则删除",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合规则删除",
|
"tags": [
|
||||||
|
"地址簿规则"
|
||||||
|
],
|
||||||
|
"summary": "地址簿规则删除",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "地址簿集合规则信息",
|
"description": "地址簿规则信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -720,14 +741,17 @@ const docTemplateadmin = `{
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合规则详情",
|
"description": "地址簿规则详情",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合规则详情",
|
"tags": [
|
||||||
|
"地址簿规则"
|
||||||
|
],
|
||||||
|
"summary": "地址簿规则详情",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@@ -772,14 +796,17 @@ const docTemplateadmin = `{
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合规则列表",
|
"description": "地址簿规则列表",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合规则列表",
|
"tags": [
|
||||||
|
"地址簿规则"
|
||||||
|
],
|
||||||
|
"summary": "地址簿规则列表",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@@ -847,17 +874,20 @@ const docTemplateadmin = `{
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合规则编辑",
|
"description": "地址簿规则编辑",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合规则编辑",
|
"tags": [
|
||||||
|
"地址簿规则"
|
||||||
|
],
|
||||||
|
"summary": "地址簿规则编辑",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "地址簿集合规则信息",
|
"description": "地址簿规则信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -2011,6 +2041,51 @@ const docTemplateadmin = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/admin/peer/batchDelete": {
|
||||||
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"token": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "批量设备删除",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"设备"
|
||||||
|
],
|
||||||
|
"summary": "批量设备删除",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "设备id",
|
||||||
|
"name": "body",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/admin.PeerBatchDeleteForm"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/response.Response"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"description": "Internal Server Error",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/response.Response"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/admin/peer/create": {
|
"/admin/peer/create": {
|
||||||
"post": {
|
"post": {
|
||||||
"security": [
|
"security": [
|
||||||
@@ -2075,7 +2150,7 @@ const docTemplateadmin = `{
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "批量设备删除",
|
"description": "设备删除",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
@@ -2085,15 +2160,15 @@ const docTemplateadmin = `{
|
|||||||
"tags": [
|
"tags": [
|
||||||
"设备"
|
"设备"
|
||||||
],
|
],
|
||||||
"summary": "批量设备删除",
|
"summary": "设备删除",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "设备id",
|
"description": "设备信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/admin.PeerBatchDeleteForm"
|
"$ref": "#/definitions/admin.PeerForm"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -346,17 +346,20 @@
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "创建地址簿集合",
|
"description": "创建地址簿名称",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "创建地址簿集合",
|
"tags": [
|
||||||
|
"地址簿名称"
|
||||||
|
],
|
||||||
|
"summary": "创建地址簿名称",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "地址簿集合信息",
|
"description": "地址簿名称信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -400,17 +403,20 @@
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合删除",
|
"description": "地址簿名称删除",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合删除",
|
"tags": [
|
||||||
|
"地址簿名称"
|
||||||
|
],
|
||||||
|
"summary": "地址簿名称删除",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "地址簿集合信息",
|
"description": "地址簿名称信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -442,14 +448,17 @@
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合详情",
|
"description": "地址簿名称详情",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合详情",
|
"tags": [
|
||||||
|
"地址簿名称"
|
||||||
|
],
|
||||||
|
"summary": "地址簿名称详情",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@@ -494,14 +503,17 @@
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合列表",
|
"description": "地址簿名称列表",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合列表",
|
"tags": [
|
||||||
|
"地址簿名称"
|
||||||
|
],
|
||||||
|
"summary": "地址簿名称列表",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@@ -563,17 +575,20 @@
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合编辑",
|
"description": "地址簿名称编辑",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合编辑",
|
"tags": [
|
||||||
|
"地址簿名称"
|
||||||
|
],
|
||||||
|
"summary": "地址簿名称编辑",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "地址簿集合信息",
|
"description": "地址簿名称信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -617,17 +632,20 @@
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "创建地址簿集合规则",
|
"description": "创建地址簿规则",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "创建地址簿集合规则",
|
"tags": [
|
||||||
|
"地址簿规则"
|
||||||
|
],
|
||||||
|
"summary": "创建地址簿规则",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "地址簿集合规则信息",
|
"description": "地址簿规则信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -671,17 +689,20 @@
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合规则删除",
|
"description": "地址簿规则删除",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合规则删除",
|
"tags": [
|
||||||
|
"地址簿规则"
|
||||||
|
],
|
||||||
|
"summary": "地址簿规则删除",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "地址簿集合规则信息",
|
"description": "地址簿规则信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -713,14 +734,17 @@
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合规则详情",
|
"description": "地址簿规则详情",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合规则详情",
|
"tags": [
|
||||||
|
"地址簿规则"
|
||||||
|
],
|
||||||
|
"summary": "地址簿规则详情",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@@ -765,14 +789,17 @@
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合规则列表",
|
"description": "地址簿规则列表",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合规则列表",
|
"tags": [
|
||||||
|
"地址簿规则"
|
||||||
|
],
|
||||||
|
"summary": "地址簿规则列表",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@@ -840,17 +867,20 @@
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "地址簿集合规则编辑",
|
"description": "地址簿规则编辑",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "地址簿集合规则编辑",
|
"tags": [
|
||||||
|
"地址簿规则"
|
||||||
|
],
|
||||||
|
"summary": "地址簿规则编辑",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "地址簿集合规则信息",
|
"description": "地址簿规则信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -2004,6 +2034,51 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/admin/peer/batchDelete": {
|
||||||
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"token": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "批量设备删除",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"设备"
|
||||||
|
],
|
||||||
|
"summary": "批量设备删除",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "设备id",
|
||||||
|
"name": "body",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/admin.PeerBatchDeleteForm"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/response.Response"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"description": "Internal Server Error",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/response.Response"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/admin/peer/create": {
|
"/admin/peer/create": {
|
||||||
"post": {
|
"post": {
|
||||||
"security": [
|
"security": [
|
||||||
@@ -2068,7 +2143,7 @@
|
|||||||
"token": []
|
"token": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "批量设备删除",
|
"description": "设备删除",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
@@ -2078,15 +2153,15 @@
|
|||||||
"tags": [
|
"tags": [
|
||||||
"设备"
|
"设备"
|
||||||
],
|
],
|
||||||
"summary": "批量设备删除",
|
"summary": "设备删除",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"description": "设备id",
|
"description": "设备信息",
|
||||||
"name": "body",
|
"name": "body",
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/admin.PeerBatchDeleteForm"
|
"$ref": "#/definitions/admin.PeerForm"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -903,9 +903,9 @@ paths:
|
|||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: 创建地址簿集合
|
description: 创建地址簿名称
|
||||||
parameters:
|
parameters:
|
||||||
- description: 地址簿集合信息
|
- description: 地址簿名称信息
|
||||||
in: body
|
in: body
|
||||||
name: body
|
name: body
|
||||||
required: true
|
required: true
|
||||||
@@ -929,14 +929,16 @@ paths:
|
|||||||
$ref: '#/definitions/response.Response'
|
$ref: '#/definitions/response.Response'
|
||||||
security:
|
security:
|
||||||
- token: []
|
- token: []
|
||||||
summary: 创建地址簿集合
|
summary: 创建地址簿名称
|
||||||
|
tags:
|
||||||
|
- 地址簿名称
|
||||||
/admin/address_book_collection/delete:
|
/admin/address_book_collection/delete:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: 地址簿集合删除
|
description: 地址簿名称删除
|
||||||
parameters:
|
parameters:
|
||||||
- description: 地址簿集合信息
|
- description: 地址簿名称信息
|
||||||
in: body
|
in: body
|
||||||
name: body
|
name: body
|
||||||
required: true
|
required: true
|
||||||
@@ -955,12 +957,14 @@ paths:
|
|||||||
$ref: '#/definitions/response.Response'
|
$ref: '#/definitions/response.Response'
|
||||||
security:
|
security:
|
||||||
- token: []
|
- token: []
|
||||||
summary: 地址簿集合删除
|
summary: 地址簿名称删除
|
||||||
|
tags:
|
||||||
|
- 地址簿名称
|
||||||
/admin/address_book_collection/detail/{id}:
|
/admin/address_book_collection/detail/{id}:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: 地址簿集合详情
|
description: 地址簿名称详情
|
||||||
parameters:
|
parameters:
|
||||||
- description: ID
|
- description: ID
|
||||||
in: path
|
in: path
|
||||||
@@ -985,12 +989,14 @@ paths:
|
|||||||
$ref: '#/definitions/response.Response'
|
$ref: '#/definitions/response.Response'
|
||||||
security:
|
security:
|
||||||
- token: []
|
- token: []
|
||||||
summary: 地址簿集合详情
|
summary: 地址簿名称详情
|
||||||
|
tags:
|
||||||
|
- 地址簿名称
|
||||||
/admin/address_book_collection/list:
|
/admin/address_book_collection/list:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: 地址簿集合列表
|
description: 地址簿名称列表
|
||||||
parameters:
|
parameters:
|
||||||
- description: 页码
|
- description: 页码
|
||||||
in: query
|
in: query
|
||||||
@@ -1026,14 +1032,16 @@ paths:
|
|||||||
$ref: '#/definitions/response.Response'
|
$ref: '#/definitions/response.Response'
|
||||||
security:
|
security:
|
||||||
- token: []
|
- token: []
|
||||||
summary: 地址簿集合列表
|
summary: 地址簿名称列表
|
||||||
|
tags:
|
||||||
|
- 地址簿名称
|
||||||
/admin/address_book_collection/update:
|
/admin/address_book_collection/update:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: 地址簿集合编辑
|
description: 地址簿名称编辑
|
||||||
parameters:
|
parameters:
|
||||||
- description: 地址簿集合信息
|
- description: 地址簿名称信息
|
||||||
in: body
|
in: body
|
||||||
name: body
|
name: body
|
||||||
required: true
|
required: true
|
||||||
@@ -1057,14 +1065,16 @@ paths:
|
|||||||
$ref: '#/definitions/response.Response'
|
$ref: '#/definitions/response.Response'
|
||||||
security:
|
security:
|
||||||
- token: []
|
- token: []
|
||||||
summary: 地址簿集合编辑
|
summary: 地址簿名称编辑
|
||||||
|
tags:
|
||||||
|
- 地址簿名称
|
||||||
/admin/address_book_collection_rule/create:
|
/admin/address_book_collection_rule/create:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: 创建地址簿集合规则
|
description: 创建地址簿规则
|
||||||
parameters:
|
parameters:
|
||||||
- description: 地址簿集合规则信息
|
- description: 地址簿规则信息
|
||||||
in: body
|
in: body
|
||||||
name: body
|
name: body
|
||||||
required: true
|
required: true
|
||||||
@@ -1088,14 +1098,16 @@ paths:
|
|||||||
$ref: '#/definitions/response.Response'
|
$ref: '#/definitions/response.Response'
|
||||||
security:
|
security:
|
||||||
- token: []
|
- token: []
|
||||||
summary: 创建地址簿集合规则
|
summary: 创建地址簿规则
|
||||||
|
tags:
|
||||||
|
- 地址簿规则
|
||||||
/admin/address_book_collection_rule/delete:
|
/admin/address_book_collection_rule/delete:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: 地址簿集合规则删除
|
description: 地址簿规则删除
|
||||||
parameters:
|
parameters:
|
||||||
- description: 地址簿集合规则信息
|
- description: 地址簿规则信息
|
||||||
in: body
|
in: body
|
||||||
name: body
|
name: body
|
||||||
required: true
|
required: true
|
||||||
@@ -1114,12 +1126,14 @@ paths:
|
|||||||
$ref: '#/definitions/response.Response'
|
$ref: '#/definitions/response.Response'
|
||||||
security:
|
security:
|
||||||
- token: []
|
- token: []
|
||||||
summary: 地址簿集合规则删除
|
summary: 地址簿规则删除
|
||||||
|
tags:
|
||||||
|
- 地址簿规则
|
||||||
/admin/address_book_collection_rule/detail/{id}:
|
/admin/address_book_collection_rule/detail/{id}:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: 地址簿集合规则详情
|
description: 地址簿规则详情
|
||||||
parameters:
|
parameters:
|
||||||
- description: ID
|
- description: ID
|
||||||
in: path
|
in: path
|
||||||
@@ -1144,12 +1158,14 @@ paths:
|
|||||||
$ref: '#/definitions/response.Response'
|
$ref: '#/definitions/response.Response'
|
||||||
security:
|
security:
|
||||||
- token: []
|
- token: []
|
||||||
summary: 地址簿集合规则详情
|
summary: 地址簿规则详情
|
||||||
|
tags:
|
||||||
|
- 地址簿规则
|
||||||
/admin/address_book_collection_rule/list:
|
/admin/address_book_collection_rule/list:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: 地址簿集合规则列表
|
description: 地址簿规则列表
|
||||||
parameters:
|
parameters:
|
||||||
- description: 页码
|
- description: 页码
|
||||||
in: query
|
in: query
|
||||||
@@ -1189,14 +1205,16 @@ paths:
|
|||||||
$ref: '#/definitions/response.Response'
|
$ref: '#/definitions/response.Response'
|
||||||
security:
|
security:
|
||||||
- token: []
|
- token: []
|
||||||
summary: 地址簿集合规则列表
|
summary: 地址簿规则列表
|
||||||
|
tags:
|
||||||
|
- 地址簿规则
|
||||||
/admin/address_book_collection_rule/update:
|
/admin/address_book_collection_rule/update:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: 地址簿集合规则编辑
|
description: 地址簿规则编辑
|
||||||
parameters:
|
parameters:
|
||||||
- description: 地址簿集合规则信息
|
- description: 地址簿规则信息
|
||||||
in: body
|
in: body
|
||||||
name: body
|
name: body
|
||||||
required: true
|
required: true
|
||||||
@@ -1220,7 +1238,9 @@ paths:
|
|||||||
$ref: '#/definitions/response.Response'
|
$ref: '#/definitions/response.Response'
|
||||||
security:
|
security:
|
||||||
- token: []
|
- token: []
|
||||||
summary: 地址簿集合规则编辑
|
summary: 地址簿规则编辑
|
||||||
|
tags:
|
||||||
|
- 地址簿规则
|
||||||
/admin/app-config:
|
/admin/app-config:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
@@ -1890,6 +1910,34 @@ paths:
|
|||||||
summary: OidcAuthQuery
|
summary: OidcAuthQuery
|
||||||
tags:
|
tags:
|
||||||
- Oauth
|
- Oauth
|
||||||
|
/admin/peer/batchDelete:
|
||||||
|
post:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: 批量设备删除
|
||||||
|
parameters:
|
||||||
|
- description: 设备id
|
||||||
|
in: body
|
||||||
|
name: body
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/admin.PeerBatchDeleteForm'
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/response.Response'
|
||||||
|
"500":
|
||||||
|
description: Internal Server Error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/response.Response'
|
||||||
|
security:
|
||||||
|
- token: []
|
||||||
|
summary: 批量设备删除
|
||||||
|
tags:
|
||||||
|
- 设备
|
||||||
/admin/peer/create:
|
/admin/peer/create:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
@@ -1927,14 +1975,14 @@ paths:
|
|||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: 批量设备删除
|
description: 设备删除
|
||||||
parameters:
|
parameters:
|
||||||
- description: 设备id
|
- description: 设备信息
|
||||||
in: body
|
in: body
|
||||||
name: body
|
name: body
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/admin.PeerBatchDeleteForm'
|
$ref: '#/definitions/admin.PeerForm'
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
@@ -1948,7 +1996,7 @@ paths:
|
|||||||
$ref: '#/definitions/response.Response'
|
$ref: '#/definitions/response.Response'
|
||||||
security:
|
security:
|
||||||
- token: []
|
- token: []
|
||||||
summary: 批量设备删除
|
summary: 设备删除
|
||||||
tags:
|
tags:
|
||||||
- 设备
|
- 设备
|
||||||
/admin/peer/detail/{id}:
|
/admin/peer/detail/{id}:
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ import (
|
|||||||
type AddressBookCollection struct {
|
type AddressBookCollection struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detail 地址簿集合
|
// Detail 地址簿名称
|
||||||
// @AddressBookCollections 地址簿集合
|
// @Tags 地址簿名称
|
||||||
// @Summary 地址簿集合详情
|
// @Summary 地址簿名称详情
|
||||||
// @Description 地址簿集合详情
|
// @Description 地址簿名称详情
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param id path int true "ID"
|
// @Param id path int true "ID"
|
||||||
@@ -42,13 +42,13 @@ func (abc *AddressBookCollection) Detail(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create 创建地址簿集合
|
// Create 创建地址簿名称
|
||||||
// @AddressBookCollections 地址簿集合
|
// @Tags 地址簿名称
|
||||||
// @Summary 创建地址簿集合
|
// @Summary 创建地址簿名称
|
||||||
// @Description 创建地址簿集合
|
// @Description 创建地址簿名称
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param body body model.AddressBookCollection true "地址簿集合信息"
|
// @Param body body model.AddressBookCollection true "地址簿名称信息"
|
||||||
// @Success 200 {object} response.Response{data=model.AddressBookCollection}
|
// @Success 200 {object} response.Response{data=model.AddressBookCollection}
|
||||||
// @Failure 500 {object} response.Response
|
// @Failure 500 {object} response.Response
|
||||||
// @Router /admin/address_book_collection/create [post]
|
// @Router /admin/address_book_collection/create [post]
|
||||||
@@ -79,9 +79,9 @@ func (abc *AddressBookCollection) Create(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// List 列表
|
// List 列表
|
||||||
// @AddressBookCollections 地址簿集合
|
// @Tags 地址簿名称
|
||||||
// @Summary 地址簿集合列表
|
// @Summary 地址簿名称列表
|
||||||
// @Description 地址簿集合列表
|
// @Description 地址簿名称列表
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param page query int false "页码"
|
// @Param page query int false "页码"
|
||||||
@@ -111,12 +111,12 @@ func (abc *AddressBookCollection) List(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update 编辑
|
// Update 编辑
|
||||||
// @AddressBookCollections 地址簿集合
|
// @Tags 地址簿名称
|
||||||
// @Summary 地址簿集合编辑
|
// @Summary 地址簿名称编辑
|
||||||
// @Description 地址簿集合编辑
|
// @Description 地址簿名称编辑
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param body body model.AddressBookCollection true "地址簿集合信息"
|
// @Param body body model.AddressBookCollection true "地址簿名称信息"
|
||||||
// @Success 200 {object} response.Response{data=model.AddressBookCollection}
|
// @Success 200 {object} response.Response{data=model.AddressBookCollection}
|
||||||
// @Failure 500 {object} response.Response
|
// @Failure 500 {object} response.Response
|
||||||
// @Router /admin/address_book_collection/update [post]
|
// @Router /admin/address_book_collection/update [post]
|
||||||
@@ -151,12 +151,12 @@ func (abc *AddressBookCollection) Update(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete 删除
|
// Delete 删除
|
||||||
// @AddressBookCollections 地址簿集合
|
// @Tags 地址簿名称
|
||||||
// @Summary 地址簿集合删除
|
// @Summary 地址簿名称删除
|
||||||
// @Description 地址簿集合删除
|
// @Description 地址簿名称删除
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param body body model.AddressBookCollection true "地址簿集合信息"
|
// @Param body body model.AddressBookCollection true "地址簿名称信息"
|
||||||
// @Success 200 {object} response.Response
|
// @Success 200 {object} response.Response
|
||||||
// @Failure 500 {object} response.Response
|
// @Failure 500 {object} response.Response
|
||||||
// @Router /admin/address_book_collection/delete [post]
|
// @Router /admin/address_book_collection/delete [post]
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ type AddressBookCollectionRule struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// List 列表
|
// List 列表
|
||||||
// @AddressBookCollectionRule 地址簿集合规则
|
// @Tags 地址簿规则
|
||||||
// @Summary 地址簿集合规则列表
|
// @Summary 地址簿规则列表
|
||||||
// @Description 地址簿集合规则列表
|
// @Description 地址簿规则列表
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param page query int false "页码"
|
// @Param page query int false "页码"
|
||||||
@@ -51,10 +51,10 @@ func (abcr *AddressBookCollectionRule) List(c *gin.Context) {
|
|||||||
response.Success(c, res)
|
response.Success(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detail 地址簿集合规则
|
// Detail 地址簿规则
|
||||||
// @AddressBookCollectionRule 地址簿集合规则
|
// @Tags 地址簿规则
|
||||||
// @Summary 地址簿集合规则详情
|
// @Summary 地址簿规则详情
|
||||||
// @Description 地址簿集合规则详情
|
// @Description 地址簿规则详情
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param id path int true "ID"
|
// @Param id path int true "ID"
|
||||||
@@ -79,13 +79,13 @@ func (abcr *AddressBookCollectionRule) Detail(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create 创建地址簿集合规则
|
// Create 创建地址簿规则
|
||||||
// @AddressBookCollectionRule 地址簿集合规则
|
// @Tags 地址簿规则
|
||||||
// @Summary 创建地址簿集合规则
|
// @Summary 创建地址簿规则
|
||||||
// @Description 创建地址簿集合规则
|
// @Description 创建地址簿规则
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param body body model.AddressBookCollectionRule true "地址簿集合规则信息"
|
// @Param body body model.AddressBookCollectionRule true "地址簿规则信息"
|
||||||
// @Success 200 {object} response.Response{data=model.AddressBookCollection}
|
// @Success 200 {object} response.Response{data=model.AddressBookCollection}
|
||||||
// @Failure 500 {object} response.Response
|
// @Failure 500 {object} response.Response
|
||||||
// @Router /admin/address_book_collection_rule/create [post]
|
// @Router /admin/address_book_collection_rule/create [post]
|
||||||
@@ -169,12 +169,12 @@ func (abcr *AddressBookCollectionRule) CheckForm(u *model.User, t *model.Address
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update 编辑
|
// Update 编辑
|
||||||
// @AddressBookCollectionRule 地址簿集合规则
|
// @Tags 地址簿规则
|
||||||
// @Summary 地址簿集合规则编辑
|
// @Summary 地址簿规则编辑
|
||||||
// @Description 地址簿集合规则编辑
|
// @Description 地址簿规则编辑
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param body body model.AddressBookCollectionRule true "地址簿集合规则信息"
|
// @Param body body model.AddressBookCollectionRule true "地址簿规则信息"
|
||||||
// @Success 200 {object} response.Response{data=model.AddressBookCollection}
|
// @Success 200 {object} response.Response{data=model.AddressBookCollection}
|
||||||
// @Failure 500 {object} response.Response
|
// @Failure 500 {object} response.Response
|
||||||
// @Router /admin/address_book_collection_rule/update [post]
|
// @Router /admin/address_book_collection_rule/update [post]
|
||||||
@@ -210,12 +210,12 @@ func (abcr *AddressBookCollectionRule) Update(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete 删除
|
// Delete 删除
|
||||||
// @AddressBookCollectionRule 地址簿集合规则
|
// @Tags 地址簿规则
|
||||||
// @Summary 地址簿集合规则删除
|
// @Summary 地址簿规则删除
|
||||||
// @Description 地址簿集合规则删除
|
// @Description 地址簿规则删除
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param body body model.AddressBookCollectionRule true "地址簿集合规则信息"
|
// @Param body body model.AddressBookCollectionRule true "地址簿规则信息"
|
||||||
// @Success 200 {object} response.Response
|
// @Success 200 {object} response.Response
|
||||||
// @Failure 500 {object} response.Response
|
// @Failure 500 {object} response.Response
|
||||||
// @Router /admin/address_book_collection_rule/delete [post]
|
// @Router /admin/address_book_collection_rule/delete [post]
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ func (ct *Peer) Delete(c *gin.Context) {
|
|||||||
// @Param body body admin.PeerBatchDeleteForm true "设备id"
|
// @Param body body admin.PeerBatchDeleteForm true "设备id"
|
||||||
// @Success 200 {object} response.Response
|
// @Success 200 {object} response.Response
|
||||||
// @Failure 500 {object} response.Response
|
// @Failure 500 {object} response.Response
|
||||||
// @Router /admin/peer/delete [post]
|
// @Router /admin/peer/batchDelete [post]
|
||||||
// @Security token
|
// @Security token
|
||||||
func (ct *Peer) BatchDelete(c *gin.Context) {
|
func (ct *Peer) BatchDelete(c *gin.Context) {
|
||||||
f := &admin.PeerBatchDeleteForm{}
|
f := &admin.PeerBatchDeleteForm{}
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ func AddressBookBind(rg *gin.RouterGroup) {
|
|||||||
}
|
}
|
||||||
func PeerBind(rg *gin.RouterGroup) {
|
func PeerBind(rg *gin.RouterGroup) {
|
||||||
aR := rg.Group("/peer")
|
aR := rg.Group("/peer")
|
||||||
|
aR.POST("/simpleData", (&admin.Peer{}).SimpleData)
|
||||||
|
aR.Use(middleware.AdminPrivilege())
|
||||||
{
|
{
|
||||||
cont := &admin.Peer{}
|
cont := &admin.Peer{}
|
||||||
aR.GET("/list", cont.List)
|
aR.GET("/list", cont.List)
|
||||||
@@ -115,10 +117,7 @@ func PeerBind(rg *gin.RouterGroup) {
|
|||||||
aR.POST("/create", cont.Create)
|
aR.POST("/create", cont.Create)
|
||||||
aR.POST("/update", cont.Update)
|
aR.POST("/update", cont.Update)
|
||||||
aR.POST("/delete", cont.Delete)
|
aR.POST("/delete", cont.Delete)
|
||||||
aR.POST("/simpleData", cont.SimpleData)
|
aR.POST("/batchDelete", cont.BatchDelete)
|
||||||
|
|
||||||
arp := aR.Use(middleware.AdminPrivilege())
|
|
||||||
arp.POST("/batchDelete", cont.BatchDelete)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user