Skip to content

Commit

Permalink
wip: cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ElaBosak233 committed May 29, 2024
1 parent 5a6870d commit 6577ca8
Show file tree
Hide file tree
Showing 40 changed files with 300 additions and 671 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT_TAG := $(shell git describe --tags --always)
GIT_COMMIT := $(shell git rev-parse HEAD)
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)

LDFLAGS := -X $(PACKAGE)/internal/global.GitTag=$(GIT_TAG) -X $(PACKAGE)/internal/global.GitCommitID=$(GIT_COMMIT) -X $(PACKAGE)/internal/global.GitBranch=$(GIT_BRANCH)
LDFLAGS := -X $(PACKAGE)/internal/utils.GitTag=$(GIT_TAG) -X $(PACKAGE)/internal/utils.GitCommitID=$(GIT_COMMIT) -X $(PACKAGE)/internal/utils.GitBranch=$(GIT_BRANCH)

.PHONY: all build run clean swag

Expand All @@ -27,7 +27,7 @@ swag:

build: swag
@echo Building $(PACKAGE)...
@go build -ldflags "-linkmode external -w -s $(LDFLAGS)" -o ./build/$(BINARY)
@go build -ldflags "-linkmode external -w -s $(LDFLAGS)" -o ./build/$(BINARY) $(PACKAGE)/cmd/cloudsdale
@echo Build finished.

run: swag
Expand Down
105 changes: 0 additions & 105 deletions api/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,64 +445,6 @@ const docTemplate = `{
"responses": {}
}
},
"/challenges/{id}/hints": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Challenge"
],
"summary": "创建提示",
"responses": {}
}
},
"/challenges/{id}/hints/{hint_id}": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Challenge"
],
"summary": "更新提示",
"responses": {}
},
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Challenge"
],
"summary": "删除提示",
"responses": {}
}
},
"/configs/": {
"get": {
"description": "配置全部查询",
Expand Down Expand Up @@ -2125,12 +2067,6 @@ const docTemplate = `{
"$ref": "#/definitions/model.Flag"
}
},
"hints": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Hint"
}
},
"id": {
"description": "The challenge's id. As primary key.",
"type": "integer"
Expand Down Expand Up @@ -2365,43 +2301,6 @@ const docTemplate = `{
}
}
},
"model.Hint": {
"type": "object",
"properties": {
"challenge": {
"description": "The challenge which the hint belongs to.",
"allOf": [
{
"$ref": "#/definitions/model.Challenge"
}
]
},
"challenge_id": {
"description": "The challenge which the hint belongs to.",
"type": "integer"
},
"content": {
"description": "The content of the hint.",
"type": "string"
},
"created_at": {
"description": "The hint's creation time.",
"type": "integer"
},
"id": {
"description": "The hint's id.",
"type": "integer"
},
"published_at": {
"description": "When the hint will be published.",
"type": "integer"
},
"updated_at": {
"description": "The hint's last update time.",
"type": "integer"
}
}
},
"model.Port": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2627,10 +2526,6 @@ const docTemplate = `{
"description": "The user's password. Crypt.",
"type": "string"
},
"signature": {
"description": "The user's signature.",
"type": "string"
},
"teams": {
"description": "The user's teams.",
"type": "array",
Expand Down
105 changes: 0 additions & 105 deletions api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -436,64 +436,6 @@
"responses": {}
}
},
"/challenges/{id}/hints": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Challenge"
],
"summary": "创建提示",
"responses": {}
}
},
"/challenges/{id}/hints/{hint_id}": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Challenge"
],
"summary": "更新提示",
"responses": {}
},
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Challenge"
],
"summary": "删除提示",
"responses": {}
}
},
"/configs/": {
"get": {
"description": "配置全部查询",
Expand Down Expand Up @@ -2116,12 +2058,6 @@
"$ref": "#/definitions/model.Flag"
}
},
"hints": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Hint"
}
},
"id": {
"description": "The challenge's id. As primary key.",
"type": "integer"
Expand Down Expand Up @@ -2356,43 +2292,6 @@
}
}
},
"model.Hint": {
"type": "object",
"properties": {
"challenge": {
"description": "The challenge which the hint belongs to.",
"allOf": [
{
"$ref": "#/definitions/model.Challenge"
}
]
},
"challenge_id": {
"description": "The challenge which the hint belongs to.",
"type": "integer"
},
"content": {
"description": "The content of the hint.",
"type": "string"
},
"created_at": {
"description": "The hint's creation time.",
"type": "integer"
},
"id": {
"description": "The hint's id.",
"type": "integer"
},
"published_at": {
"description": "When the hint will be published.",
"type": "integer"
},
"updated_at": {
"description": "The hint's last update time.",
"type": "integer"
}
}
},
"model.Port": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2618,10 +2517,6 @@
"description": "The user's password. Crypt.",
"type": "string"
},
"signature": {
"description": "The user's signature.",
"type": "string"
},
"teams": {
"description": "The user's teams.",
"type": "array",
Expand Down
67 changes: 0 additions & 67 deletions api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ definitions:
items:
$ref: '#/definitions/model.Flag'
type: array
hints:
items:
$ref: '#/definitions/model.Hint'
type: array
id:
description: The challenge's id. As primary key.
type: integer
Expand Down Expand Up @@ -234,31 +230,6 @@ definitions:
pts:
type: integer
type: object
model.Hint:
properties:
challenge:
allOf:
- $ref: '#/definitions/model.Challenge'
description: The challenge which the hint belongs to.
challenge_id:
description: The challenge which the hint belongs to.
type: integer
content:
description: The content of the hint.
type: string
created_at:
description: The hint's creation time.
type: integer
id:
description: The hint's id.
type: integer
published_at:
description: When the hint will be published.
type: integer
updated_at:
description: The hint's last update time.
type: integer
type: object
model.Port:
properties:
challenge:
Expand Down Expand Up @@ -410,9 +381,6 @@ definitions:
password:
description: The user's password. Crypt.
type: string
signature:
description: The user's signature.
type: string
teams:
description: The user's teams.
items:
Expand Down Expand Up @@ -1084,41 +1052,6 @@ paths:
summary: 更新 flag
tags:
- Challenge
/challenges/{id}/hints:
post:
consumes:
- application/json
produces:
- application/json
responses: {}
security:
- ApiKeyAuth: []
summary: 创建提示
tags:
- Challenge
/challenges/{id}/hints/{hint_id}:
delete:
consumes:
- application/json
produces:
- application/json
responses: {}
security:
- ApiKeyAuth: []
summary: 删除提示
tags:
- Challenge
put:
consumes:
- application/json
produces:
- application/json
responses: {}
security:
- ApiKeyAuth: []
summary: 更新提示
tags:
- Challenge
/configs/:
get:
consumes:
Expand Down
Loading

0 comments on commit 6577ca8

Please sign in to comment.