发送 POST 后,我收到 400 错误
curl localhost:8888/bills/addbill -H "Content-Type: application/json" -X POST -d '{"number":"111A111", "customer":"Customer Cuustomer Rrrr", "phone":"1 800 5551212", "manager":"Manager Manager Manager", "date":"2012-09-17", "curId":{"id":"1"}, "payments":{["id":"1"]}}'
回应是:
{"timestamp":1503684882518,"status":400,"error":"Bad Request","exception":"org.springframework.http.converter.HttpMessageNotReadableException","message":"Bad Request","path":"/bills/addbill"}
当我尝试反序列化我的 json 数据时出现异常。如何正确反序列化 JSON?
账单实体文件是:
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import ru.test.practice.view.PaymentView;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@Entity
@Table(name = "Bill")
public class Bill {
@GeneratedValue
@Id
@Column(name = "id")
private Integer id;
@Version
private int version;
@Column(name = "number")
@NotNull(message = "Num should be set") …Run Code Online (Sandbox Code Playgroud) Workbook workbook = new HSSFWorkbook();
Sheet worksheet = workbook.createSheet("test sheet");
Row row1 = worksheet.createRow(0);
Cell cell0 = row1.createCell(0);
CellStyle testStyle = workbook.createCellStyle();
testStyle.setFillBackgroundColor(IndexedColors.RED.getIndex());
cell0.setCellStyle(testStyle);
Run Code Online (Sandbox Code Playgroud)
我正在尝试将单元格的背景颜色更改为红色。但是实际上单元格的背景颜色没有改变。还是白的