chore: replace all cn comments to en version by volc api (#313)

This commit is contained in:
tecvan
2025-07-31 15:18:11 +08:00
committed by GitHub
parent 91d6cdb430
commit 5abc63fba6
254 changed files with 5899 additions and 5844 deletions

View File

@@ -267,7 +267,7 @@ func GetUploadAuthToken(ctx context.Context, c *app.RequestContext) {
func createSecret(uid int64, fileType string) string {
num := 10
input := fmt.Sprintf("upload_%d_Ma*9)fhi_%d_gou_%s_rand_%d", uid, time.Now().Unix(), fileType, rand.Intn(100000))
// 做md5取前20,// mapIntToBase62 把数字映射到 Base62
// Do md5, take the first 20,//mapIntToBase62 map the number to Base62
hash := sha256.Sum256([]byte(fmt.Sprintf("%s", input)))
hashString := base64.StdEncoding.EncodeToString(hash[:])
if len(hashString) > num {

View File

@@ -138,7 +138,7 @@ func CreatePersonalAccessTokenAndPermission(ctx context.Context, c *app.RequestC
c.JSON(consts.StatusOK, resp)
}
// checkCPATParams 检查创建个人访问令牌的参数
// checkCPATParams Check parameters for creating personal access tokens
func checkCPATParams(ctx context.Context, req *openapiauth.CreatePersonalAccessTokenAndPermissionRequest) error {
if req.Name == "" {

View File

@@ -159,7 +159,7 @@ func UserUpdateAvatar(ctx context.Context, c *app.RequestContext) {
var err error
var req passport.UserUpdateAvatarRequest
// 获取上传的文件
// Get the uploaded file
file, err := c.FormFile("avatar")
if err != nil {
logs.CtxErrorf(ctx, "Get Avatar Fail failed, err=%v", err)
@@ -167,13 +167,13 @@ func UserUpdateAvatar(ctx context.Context, c *app.RequestContext) {
return
}
// 检查文件类型
// Check file type
if !strings.HasPrefix(file.Header.Get("Content-Type"), "image/") {
invalidParamRequestResponse(c, "invalid file type, only image allowed")
return
}
// 读取文件内容
// Read file content
src, err := file.Open()
if err != nil {
internalServerErrorResponse(ctx, c, err)