Skip to content

Commit 02b536c

Browse files
committed
Merge remote-tracking branch 'github/test' into release/1.0.6
# Conflicts: # i18n/i18n.yaml
2 parents 98f49d1 + 4bc366c commit 02b536c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+877
-230
lines changed

docs/docs.go

Lines changed: 16 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/swagger.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5972,9 +5972,6 @@
59725972
"schema.GetOtherUserInfoResp": {
59735973
"type": "object",
59745974
"properties": {
5975-
"has": {
5976-
"type": "boolean"
5977-
},
59785975
"info": {
59795976
"$ref": "#/definitions/schema.GetOtherUserInfoByUsernameResp"
59805977
}
@@ -6974,7 +6971,11 @@
69746971
},
69756972
"user_info": {
69766973
"description": "user info",
6977-
"$ref": "#/definitions/schema.UserBasicInfo"
6974+
"allOf": [
6975+
{
6976+
"$ref": "#/definitions/schema.UserBasicInfo"
6977+
}
6978+
]
69786979
},
69796980
"vote_count": {
69806981
"type": "integer"
@@ -6986,7 +6987,11 @@
69866987
"properties": {
69876988
"object": {
69886989
"description": "this object",
6989-
"$ref": "#/definitions/schema.SearchObject"
6990+
"allOf": [
6991+
{
6992+
"$ref": "#/definitions/schema.SearchObject"
6993+
}
6994+
]
69906995
},
69916996
"object_type": {
69926997
"description": "object_type",
@@ -7499,7 +7504,11 @@
74997504
"properties": {
75007505
"avatar": {
75017506
"description": "avatar",
7502-
"$ref": "#/definitions/schema.AvatarInfo"
7507+
"allOf": [
7508+
{
7509+
"$ref": "#/definitions/schema.AvatarInfo"
7510+
}
7511+
]
75037512
},
75047513
"bio": {
75057514
"description": "bio",
@@ -7676,7 +7685,6 @@
76767685
],
76777686
"properties": {
76787687
"status": {
7679-
"description": "user status",
76807688
"type": "string",
76817689
"enum": [
76827690
"normal",
@@ -7686,7 +7694,6 @@
76867694
]
76877695
},
76887696
"user_id": {
7689-
"description": "user id",
76907697
"type": "string"
76917698
}
76927699
}

docs/swagger.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,6 @@ definitions:
488488
type: object
489489
schema.GetOtherUserInfoResp:
490490
properties:
491-
has:
492-
type: boolean
493491
info:
494492
$ref: '#/definitions/schema.GetOtherUserInfoByUsernameResp'
495493
type: object
@@ -1201,15 +1199,17 @@ definitions:
12011199
title:
12021200
type: string
12031201
user_info:
1204-
$ref: '#/definitions/schema.UserBasicInfo'
1202+
allOf:
1203+
- $ref: '#/definitions/schema.UserBasicInfo'
12051204
description: user info
12061205
vote_count:
12071206
type: integer
12081207
type: object
12091208
schema.SearchResp:
12101209
properties:
12111210
object:
1212-
$ref: '#/definitions/schema.SearchObject'
1211+
allOf:
1212+
- $ref: '#/definitions/schema.SearchObject'
12131213
description: this object
12141214
object_type:
12151215
description: object_type
@@ -1563,7 +1563,8 @@ definitions:
15631563
schema.UpdateInfoRequest:
15641564
properties:
15651565
avatar:
1566-
$ref: '#/definitions/schema.AvatarInfo'
1566+
allOf:
1567+
- $ref: '#/definitions/schema.AvatarInfo'
15671568
description: avatar
15681569
bio:
15691570
description: bio
@@ -1691,15 +1692,13 @@ definitions:
16911692
schema.UpdateUserStatusReq:
16921693
properties:
16931694
status:
1694-
description: user status
16951695
enum:
16961696
- normal
16971697
- suspended
16981698
- deleted
16991699
- inactive
17001700
type: string
17011701
user_id:
1702-
description: user id
17031702
type: string
17041703
required:
17051704
- status

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ require (
3535
github.com/segmentfault/pacman/contrib/server/http v0.0.0-20221018072427-a15dd1434e05
3636
github.com/spf13/cobra v1.6.1
3737
github.com/stretchr/testify v1.8.1
38-
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a
38+
github.com/swaggo/files v1.0.0
3939
github.com/swaggo/gin-swagger v1.5.3
40-
github.com/swaggo/swag v1.8.7
40+
github.com/swaggo/swag v1.8.10
4141
github.com/tidwall/gjson v1.14.4
4242
github.com/yuin/goldmark v1.4.13
4343
golang.org/x/crypto v0.1.0
44-
golang.org/x/net v0.1.0
44+
golang.org/x/net v0.2.0
4545
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
4646
gopkg.in/yaml.v3 v3.0.1
4747
modernc.org/sqlite v1.14.2
@@ -121,7 +121,7 @@ require (
121121
go.uber.org/zap v1.23.0 // indirect
122122
golang.org/x/image v0.1.0 // indirect
123123
golang.org/x/mod v0.6.0 // indirect
124-
golang.org/x/sys v0.1.0 // indirect
124+
golang.org/x/sys v0.2.0 // indirect
125125
golang.org/x/text v0.5.0 // indirect
126126
golang.org/x/tools v0.2.0 // indirect
127127
google.golang.org/protobuf v1.28.1 // indirect

go.sum

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -668,13 +668,14 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs
668668
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
669669
github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs=
670670
github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
671-
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a h1:kAe4YSu0O0UFn1DowNo2MY5p6xzqtJ/wQ7LZynSvGaY=
672671
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w=
672+
github.com/swaggo/files v1.0.0 h1:1gGXVIeUFCS/dta17rnP0iOpr6CXFwKD7EO5ID233e4=
673+
github.com/swaggo/files v1.0.0/go.mod h1:N59U6URJLyU1PQgFqPM7wXLMhJx7QAolnvfQkqO13kc=
673674
github.com/swaggo/gin-swagger v1.5.3 h1:8mWmHLolIbrhJJTflsaFoZzRBYVmEE7JZGIq08EiC0Q=
674675
github.com/swaggo/gin-swagger v1.5.3/go.mod h1:3XJKSfHjDMB5dBo/0rrTXidPmgLeqsX89Yp4uA50HpI=
675676
github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ=
676-
github.com/swaggo/swag v1.8.7 h1:2K9ivTD3teEO+2fXV6zrZKDqk5IuU2aJtBDo8U7omWU=
677-
github.com/swaggo/swag v1.8.7/go.mod h1:ezQVUUhly8dludpVk+/PuwJWvLLanB13ygV5Pr9enSk=
677+
github.com/swaggo/swag v1.8.10 h1:eExW4bFa52WOjqRzRD58bgWsWfdFJso50lpbeTcmTfo=
678+
github.com/swaggo/swag v1.8.10/go.mod h1:ezQVUUhly8dludpVk+/PuwJWvLLanB13ygV5Pr9enSk=
678679
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
679680
github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE=
680681
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
@@ -850,8 +851,8 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx
850851
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
851852
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
852853
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
853-
golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0=
854-
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
854+
golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU=
855+
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
855856
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
856857
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
857858
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -944,11 +945,12 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
944945
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
945946
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
946947
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
947-
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
948-
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
948+
golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
949+
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
949950
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
950951
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
951952
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
953+
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
952954
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
953955
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
954956
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

i18n/en_US.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ backend:
3535
other: Email and password do not match.
3636
error:
3737
admin:
38+
cannot_update_their_password:
39+
other: You cannot modify your password.
40+
cannot_modify_self_status:
41+
other: You cannot modify your status.
3842
email_or_password_wrong:
3943
other: Email and password do not match.
4044
answer:
@@ -81,6 +85,8 @@ backend:
8185
new_password_same_as_previous_setting:
8286
other: The new password is the same as the previous one.
8387
question:
88+
already_deleted:
89+
other: This post has been deleted.
8490
not_found:
8591
other: Question not found.
8692
cannot_deleted:
@@ -819,6 +825,7 @@ ui:
819825
approve: Approve
820826
reject: Reject
821827
skip: Skip
828+
discard_draft: Discard draft
822829
search:
823830
title: Search Results
824831
keywords: Keywords
@@ -1015,9 +1022,11 @@ ui:
10151022
answers: answers
10161023
accepted: Accepted
10171024
page_404:
1025+
http_error: HTTP Error 404
10181026
desc: "Unfortunately, this page doesn't exist."
10191027
back_home: Back to homepage
10201028
page_50X:
1029+
http_error: HTTP Error 500
10211030
desc: The server encountered an error and could not complete your request.
10221031
back_home: Back to homepage
10231032
page_maintenance:
@@ -1407,6 +1416,10 @@ ui:
14071416
reputation: reputation
14081417
votes: votes
14091418
prompt:
1410-
leave_page: "Are you sure you want to leave the page?"
1411-
changes_not_save: "Your changes may not be saved."
1419+
leave_page: Are you sure you want to leave the page?
1420+
changes_not_save: Your changes may not be saved.
1421+
draft:
1422+
discard_confirm: Are you sure you want to discard your draft?
1423+
messages:
1424+
post_deleted: This post has been deleted.
14121425

i18n/i18n.yaml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,41 @@
11
# all support language
22
language_options:
3-
- label: "English(US)"
3+
- label: "English"
44
value: "en_US"
5-
- label: "Español(ES)"
5+
progress: 100
6+
- label: "Español"
67
value: "es_ES"
8+
progress: 0
79
- label: "Português(BR)"
810
value: "pt_BR"
9-
- label: "Português(PT)"
11+
progress: 0
12+
- label: "Português"
1013
value: "pt_PT"
11-
- label: "Deutsch(DE)"
14+
progress: 0
15+
- label: "Deutsch"
1216
value: "de_DE"
13-
- label: "Français(FR)"
17+
progress: 4
18+
- label: "Français"
1419
value: "fr_FR"
15-
- label: "日本語(JA)"
20+
progress: 100
21+
- label: "日本語"
1622
value: "ja_JP"
17-
- label: "Italiano(IT)"
23+
progress: 0
24+
- label: "Italiano"
1825
value: "it_IT"
19-
- label: "Русский(RU)"
26+
progress: 16
27+
- label: "Русский"
2028
value: "ru_RU"
21-
- label: "简体中文(CN)"
29+
progress: 13
30+
- label: "简体中文"
2231
value: "zh_CN"
23-
- label: "繁體中文(CN)"
32+
progress: 100
33+
- label: "繁體中文"
2434
value: "zh_TW"
25-
- label: "한국어(KO)"
35+
progress: 100
36+
- label: "한국어"
2637
value: "ko_KR"
27-
- label: "Tiếng Việt(VI)"
38+
progress: 0
39+
- label: "Tiếng Việt"
2840
value: "vi_VN"
41+
progress: 0

i18n/zh_CN.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#The following fields are used for back-end
2+
23
backend:
34
base:
45
success:
@@ -80,6 +81,8 @@ backend:
8081
new_password_same_as_previous_setting:
8182
other: 新密码与之前的设置相同
8283
question:
84+
already_deleted:
85+
other: 该内容已被删除
8386
not_found:
8487
other: 问题未找到
8588
cannot_deleted:

internal/base/reason/reason.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const (
2121
QuestionCannotDeleted = "error.question.cannot_deleted"
2222
QuestionCannotClose = "error.question.cannot_close"
2323
QuestionCannotUpdate = "error.question.cannot_update"
24+
QuestionAlreadyDeleted = "error.question.already_deleted"
2425
AnswerNotFound = "error.answer.not_found"
2526
AnswerCannotDeleted = "error.answer.cannot_deleted"
2627
AnswerCannotUpdate = "error.answer.cannot_update"
@@ -64,4 +65,6 @@ const (
6465
TagCannotSetSynonymAsItself = "error.tag.cannot_set_synonym_as_itself"
6566
NotAllowedRegistration = "error.user.not_allowed_registration"
6667
SMTPConfigFromNameCannotBeEmail = "error.smtp.config_from_name_cannot_be_email"
68+
AdminCannotUpdateTheirPassword = "error.admin.cannot_update_their_password"
69+
AdminCannotModifySelfStatus = "error.admin.cannot_modify_self_status"
6770
)

0 commit comments

Comments
 (0)