阶段性提交

This commit is contained in:
刘祥超
2020-09-16 09:09:21 +08:00
parent 39fc21cf5b
commit eae2e63db3
18 changed files with 566 additions and 13 deletions

View File

@@ -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
}