我正在尝试发送PUT请求以更新数据库中的ARC行。该表的列如下:
id_shape是integer,中心是point,半径,start_angle,end_angle的类型是[[double precision,ccw是character changes
我的请求正文如下: String arcCenter = xStr + ',' + yStr;
String arcRadius = globals.pArcs[globals.selectedArcIndex].r.toString();
String arcStartAngle = globals.pArcs[globals.selectedArcIndex].startAngle.toString();
String arcEndAngle = globals.pArcs[globals.selectedArcIndex].endAngle.toString();
String arcCCW = globals.pArcs[globals.selectedArcIndex].ccw ? '\"t\"' : '\"f\"';
data = {
'id_shape': globals.selectedShapeID.toString(),
'center': {
'x': xStr,
'y': yStr,
},
'radius': arcRadius,
'start_angle': arcStartAngle,
'end_angle': arcEndAngle,
'ccw': arcCCW,
};
结果,我遇到以下错误:
invalid input syntax for type point: "{"id_shape":"3","center":{"x":"0.0","y":"893.025403784439"},"radius":"600.0","start_angle":"110.0","end_angle":"50.0","ccw":"\"f\""}"
我认为这与尝试设置的尝试有关。如何形成POINT类型的字符串?提前感谢。center
modify_arc : async function(id_shape, info_shape){
center = info_shape['center'];
radius = info_shape['radius'];
startAngle = info_shape['startAngle'];
endAngle = info_shape['endAngle'];
ccw = info_shape['ccw'];
const result = await send_query("UPDATE arc SET center = $2, radius = $3, " +
"start_angle = $4, end_angle = $5, ccw = $6 WHERE id_shape = $1",
[id_shape, center, radius, startAngle, endAngle, ccw]);
return(result);
},