Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	i18n/zh_CN.yaml
#	ui/template/homepage.html
#	ui/template/sort-btns.html
  • Loading branch information
LinkinStars committed Dec 9, 2024
2 parents 2cc7b33 + 6ae1890 commit 0e9d36f
Show file tree
Hide file tree
Showing 83 changed files with 4,327 additions and 2,463 deletions.
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build clean ui

VERSION=1.4.1
VERSION=1.4.2
BIN=answer
DIR_SRC=./cmd/answer
DOCKER_CMD=docker
Expand All @@ -21,15 +21,20 @@ universal: generate
@rm -f ${BIN}_amd64 ${BIN}_arm64

generate:
@$(GO) get github.com/google/wire/cmd/[email protected]
@$(GO) get github.com/golang/mock/[email protected]
@$(GO) get github.com/swaggo/swag/cmd/[email protected]
@$(GO) get github.com/google/wire/cmd/[email protected]
@$(GO) get go.uber.org/mock/mockgen@latest
@$(GO) install github.com/swaggo/swag/cmd/[email protected]
@$(GO) install github.com/google/wire/cmd/[email protected]
@$(GO) install github.com/golang/mock/mockgen@v1.6.0
@$(GO) install go.uber.org/mock/mockgen@latest
@$(GO) generate ./...
@$(GO) mod tidy

check:
@mockgen -version
@swag -v
@wire flags

test:
@$(GO) test ./internal/repo/repo_test

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To learn more about the project, visit [answer.apache.org](https://answer.apache
### Running with docker

```bash
docker run -d -p 9080:80 -v answer-data:/data --name answer apache/answer:1.4.1
docker run -d -p 9080:80 -v answer-data:/data --name answer apache/answer:1.4.2
```

For more information, see [Installation](https://answer.apache.org/docs/installation).
Expand All @@ -40,20 +40,20 @@ You can also check out the [plugins here](https://answer.apache.org/plugins).

### Prerequisites

- Golang >= 1.18
- Golang >= 1.22
- Node.js >= 16.17
- pnpm >= 8
- mockgen >= 1.6.0
- wire >= 0.5.0
- [mockgen](https://github.com/uber-go/mock?tab=readme-ov-file#installation) >= 1.6.0
- [wire](https://github.com/google/wire/) >= 0.5.0

### Build

```bash
# install wire and mockgen for building
# Install wire and mockgen for building. You can run `make check` to check if they are installed.
$ make generate
# install frontend dependencies and build
# Install frontend dependencies and build
$ make ui
# install backend dependencies and build
# Install backend dependencies and build
$ make build
```

Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var (
// Time is the build time of the project
Time = ""
// GoVersion is the go version of the project
GoVersion = "1.19"
GoVersion = "1.22"
// log level
logLevel = os.Getenv("LOG_LEVEL")
// log path
Expand Down
2 changes: 1 addition & 1 deletion cmd/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 47 additions & 2 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3145,6 +3145,7 @@ const docTemplate = `{
{
"enum": [
"post",
"post_attachment",
"avatar",
"branding"
],
Expand Down Expand Up @@ -4483,7 +4484,8 @@ const docTemplate = `{
"hot",
"score",
"unanswered",
"recommend"
"recommend",
"frequent"
],
"type": "string",
"name": "order",
Expand Down Expand Up @@ -9666,7 +9668,8 @@ const docTemplate = `{
"hot",
"score",
"unanswered",
"recommend"
"recommend",
"frequent"
]
},
"page": {
Expand Down Expand Up @@ -10641,6 +10644,27 @@ const docTemplate = `{
"schema.SiteWriteReq": {
"type": "object",
"properties": {
"authorized_attachment_extensions": {
"type": "array",
"items": {
"type": "string"
}
},
"authorized_image_extensions": {
"type": "array",
"items": {
"type": "string"
}
},
"max_attachment_size": {
"type": "integer"
},
"max_image_megapixel": {
"type": "integer"
},
"max_image_size": {
"type": "integer"
},
"recommend_tags": {
"type": "array",
"items": {
Expand All @@ -10664,6 +10688,27 @@ const docTemplate = `{
"schema.SiteWriteResp": {
"type": "object",
"properties": {
"authorized_attachment_extensions": {
"type": "array",
"items": {
"type": "string"
}
},
"authorized_image_extensions": {
"type": "array",
"items": {
"type": "string"
}
},
"max_attachment_size": {
"type": "integer"
},
"max_image_megapixel": {
"type": "integer"
},
"max_image_size": {
"type": "integer"
},
"recommend_tags": {
"type": "array",
"items": {
Expand Down
49 changes: 47 additions & 2 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3118,6 +3118,7 @@
{
"enum": [
"post",
"post_attachment",
"avatar",
"branding"
],
Expand Down Expand Up @@ -4456,7 +4457,8 @@
"hot",
"score",
"unanswered",
"recommend"
"recommend",
"frequent"
],
"type": "string",
"name": "order",
Expand Down Expand Up @@ -9639,7 +9641,8 @@
"hot",
"score",
"unanswered",
"recommend"
"recommend",
"frequent"
]
},
"page": {
Expand Down Expand Up @@ -10614,6 +10617,27 @@
"schema.SiteWriteReq": {
"type": "object",
"properties": {
"authorized_attachment_extensions": {
"type": "array",
"items": {
"type": "string"
}
},
"authorized_image_extensions": {
"type": "array",
"items": {
"type": "string"
}
},
"max_attachment_size": {
"type": "integer"
},
"max_image_megapixel": {
"type": "integer"
},
"max_image_size": {
"type": "integer"
},
"recommend_tags": {
"type": "array",
"items": {
Expand All @@ -10637,6 +10661,27 @@
"schema.SiteWriteResp": {
"type": "object",
"properties": {
"authorized_attachment_extensions": {
"type": "array",
"items": {
"type": "string"
}
},
"authorized_image_extensions": {
"type": "array",
"items": {
"type": "string"
}
},
"max_attachment_size": {
"type": "integer"
},
"max_image_megapixel": {
"type": "integer"
},
"max_image_size": {
"type": "integer"
},
"recommend_tags": {
"type": "array",
"items": {
Expand Down
31 changes: 31 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,7 @@ definitions:
- score
- unanswered
- recommend
- frequent
type: string
page:
minimum: 1
Expand Down Expand Up @@ -2221,6 +2222,20 @@ definitions:
type: object
schema.SiteWriteReq:
properties:
authorized_attachment_extensions:
items:
type: string
type: array
authorized_image_extensions:
items:
type: string
type: array
max_attachment_size:
type: integer
max_image_megapixel:
type: integer
max_image_size:
type: integer
recommend_tags:
items:
$ref: '#/definitions/schema.SiteWriteTag'
Expand All @@ -2236,6 +2251,20 @@ definitions:
type: object
schema.SiteWriteResp:
properties:
authorized_attachment_extensions:
items:
type: string
type: array
authorized_image_extensions:
items:
type: string
type: array
max_attachment_size:
type: integer
max_image_megapixel:
type: integer
max_image_size:
type: integer
recommend_tags:
items:
$ref: '#/definitions/schema.SiteWriteTag'
Expand Down Expand Up @@ -4767,6 +4796,7 @@ paths:
- description: identify the source of the file upload
enum:
- post
- post_attachment
- avatar
- branding
in: formData
Expand Down Expand Up @@ -5601,6 +5631,7 @@ paths:
- score
- unanswered
- recommend
- frequent
in: query
name: order
type: string
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ require (
github.com/go-playground/validator/v10 v10.22.1
github.com/go-sql-driver/mysql v1.8.1
github.com/goccy/go-json v0.10.3
github.com/golang/mock v1.6.0
github.com/google/uuid v1.6.0
github.com/google/wire v0.5.0
github.com/grokify/html-strip-tags-go v0.1.0
Expand All @@ -57,6 +56,7 @@ require (
github.com/swaggo/swag v1.16.3
github.com/tidwall/gjson v1.17.3
github.com/yuin/goldmark v1.7.4
go.uber.org/mock v0.5.0
golang.org/x/crypto v0.27.0
golang.org/x/image v0.20.0
golang.org/x/net v0.29.0
Expand Down
Loading

0 comments on commit 0e9d36f

Please sign in to comment.