mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-29 03:20:24 +08:00
阶段性提交
This commit is contained in:
@@ -45,7 +45,9 @@ func (this *HTTPWebService) FindEnabledHTTPWeb(ctx context.Context, req *pb.Find
|
||||
|
||||
result := &pb.HTTPWeb{}
|
||||
result.Id = int64(web.Id)
|
||||
result.IsOn = web.IsOn == 1
|
||||
result.Root = web.Root
|
||||
result.GzipId = int64(web.GzipId)
|
||||
return &pb.FindEnabledHTTPWebResponse{Web: result}, nil
|
||||
}
|
||||
|
||||
@@ -64,3 +66,19 @@ func (this *HTTPWebService) UpdateHTTPWeb(ctx context.Context, req *pb.UpdateHTT
|
||||
|
||||
return &pb.UpdateHTTPWebResponse{}, nil
|
||||
}
|
||||
|
||||
// 修改Gzip配置
|
||||
func (this *HTTPWebService) UpdateHTTPWebGzip(ctx context.Context, req *pb.UpdateHTTPWebGzipRequest) (*pb.UpdateHTTPWebGzipResponse, error) {
|
||||
// 校验请求
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = models.SharedHTTPWebDAO.UpdateWebGzip(req.WebId, req.GzipId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.UpdateHTTPWebGzipResponse{}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user