[UPDATE] 調整編輯顧問API,改為使用agentNo查出欲修改的資料
| | |
| | | request body : |
| | | |
| | | { |
| | | "id":11, |
| | | "agentNo":"A568420", |
| | | "name":"è¬é風", |
| | | "expertise":"å¥åº·èä¿é,å女æè²,è³ç¢è¦å,æ¨æ´»éä¼,ä¿å®å¥æª¢/è¦å,åç´
ä¿å®,æè³ç財", |
| | |
| | | } |
| | | |
| | | public Consultant editConsultant(ConsultantEditDTO editDTO) { |
| | | Consultant consultant = consultantRepository.findById(editDTO.getId()) |
| | | Consultant consultant = consultantRepository.findOneByAgentNo(editDTO.getAgentNo()) |
| | | .orElseThrow(ConsultantNotFoundException::new); |
| | | consultantDTOMapper.copyToConsultant(editDTO, consultant); |
| | | FileUtil.base64ToFile(editDTO.getPhotoBase64(), editDTO.getPhotoFileName(), applicationProperty.getFileFolderPath()); |
| | |
| | | |
| | | public class ConsultantEditDTO { |
| | | |
| | | private Long id; |
| | | // private Long id; |
| | | private String name; |
| | | private String expertise; |
| | | private String title; |
| | |
| | | private String photoFileName; |
| | | private String agentNo; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | // public Long getId() { |
| | | // return id; |
| | | // } |
| | | // public void setId(Long id) { |
| | | // this.id = id; |
| | | // } |
| | | public String getName() { |
| | | return name; |
| | | } |