mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 15:00:27 +08:00
增加请求脚本审核机制
This commit is contained in:
@@ -898,28 +898,6 @@ func (this *HTTPWebService) FindHTTPWebRequestLimit(ctx context.Context, req *pb
|
||||
return &pb.FindHTTPWebRequestLimitResponse{RequestLimitJSON: configJSON}, nil
|
||||
}
|
||||
|
||||
// UpdateHTTPWebRequestScripts 修改请求脚本
|
||||
func (this *HTTPWebService) UpdateHTTPWebRequestScripts(ctx context.Context, req *pb.UpdateHTTPWebRequestScriptsRequest) (*pb.RPCSuccess, error) {
|
||||
_, err := this.ValidateAdmin(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var tx = this.NullTx()
|
||||
var config = &serverconfigs.HTTPRequestScriptsConfig{}
|
||||
err = json.Unmarshal(req.RequestScriptsJSON, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = models.SharedHTTPWebDAO.UpdateWebRequestScripts(tx, req.HttpWebId, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return this.Success()
|
||||
}
|
||||
|
||||
// FindHTTPWebRequestScripts 查找请求脚本
|
||||
func (this *HTTPWebService) FindHTTPWebRequestScripts(ctx context.Context, req *pb.FindHTTPWebRequestScriptsRequest) (*pb.FindHTTPWebRequestScriptsResponse, error) {
|
||||
_, err := this.ValidateAdmin(ctx)
|
||||
|
||||
@@ -27,3 +27,8 @@ func (this *HTTPWebService) UpdateHTTPWebCC(ctx context.Context, req *pb.UpdateH
|
||||
func (this *HTTPWebService) FindHTTPWebCC(ctx context.Context, req *pb.FindHTTPWebCCRequest) (*pb.FindHTTPWebCCResponse, error) {
|
||||
return nil, this.NotImplementedYet()
|
||||
}
|
||||
|
||||
// UpdateHTTPWebRequestScripts 修改请求脚本
|
||||
func (this *HTTPWebService) UpdateHTTPWebRequestScripts(ctx context.Context, req *pb.UpdateHTTPWebRequestScriptsRequest) (*pb.RPCSuccess, error) {
|
||||
return nil, this.NotImplementedYet()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user