|
@@ -50,14 +50,24 @@ public class GhDetailServiceImpl implements GhDetailService {
|
|
|
|
|
|
@Override
|
|
|
public CommonResponse<Void> addGhDetail(GhDetail ghDetail) {
|
|
|
- ghDetailMapper.insert(ghDetail);
|
|
|
- return CommonResponse.success();
|
|
|
+ try {
|
|
|
+ ghDetailMapper.insert(ghDetail);
|
|
|
+ return CommonResponse.success();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("addGhDetail error", e);
|
|
|
+ }
|
|
|
+ return CommonResponse.create(500, "插入失败,可能已经存在该记录");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public CommonResponse<Void> updateDetail(GhDetail ghDetail) {
|
|
|
- ghDetailMapper.updateByPrimaryKeySelective(ghDetail);
|
|
|
- return CommonResponse.success();
|
|
|
+ try {
|
|
|
+ ghDetailMapper.updateByPrimaryKeySelective(ghDetail);
|
|
|
+ return CommonResponse.success();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("updateDetail error", e);
|
|
|
+ }
|
|
|
+ return CommonResponse.create(500, "修改失败");
|
|
|
}
|
|
|
|
|
|
@Override
|