Produced by Araxis Merge on 4/27/2018 2:59:09 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | v2.0_Sprint_15_Build_5.zip\v2.0_Sprint_15_Build_5\Unredacted\ARS_Backend\ars_app\src\main\java\gov\va\med\ars\controller | CustomerRestController.java | Tue Apr 24 14:49:54 2018 UTC |
| 2 | v2.0_Sprint_15_Build_5..zip\v2.0_Sprint_15_Build_5\Unredacted\ARS_Backend\ars_app\src\main\java\gov\va\med\ars\controller | CustomerRestController.java | Thu Apr 26 14:59:41 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 162 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package go v.va.med.a rs.control ler; | |
| 2 | ||
| 3 | import jav a.util.Lis t; | |
| 4 | ||
| 5 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
| 6 | import org .springfra mework.htt p.HttpStat us; | |
| 7 | import org .springfra mework.htt p.Response Entity; | |
| 8 | import org .springfra mework.web .bind.anno tation.Del eteMapping ; | |
| 9 | import org .springfra mework.web .bind.anno tation.Get Mapping; | |
| 10 | import org .springfra mework.web .bind.anno tation.Pat hVariable; | |
| 11 | import org .springfra mework.web .bind.anno tation.Pos tMapping; | |
| 12 | import org .springfra mework.web .bind.anno tation.Put Mapping; | |
| 13 | import org .springfra mework.web .bind.anno tation.Req uestBody; | |
| 14 | import org .springfra mework.web .bind.anno tation.Res tControlle r; | |
| 15 | ||
| 16 | import gov .va.med.ar s.model.Cu stomer; | |
| 17 | import gov .va.med.ar s.service. ICustomerS ervice; | |
| 18 | /** | |
| 19 | * | |
| 20 | * @author PI I
|
|
| 21 | * | |
| 22 | */ | |
| 23 | @RestContr oller | |
| 24 | public cla ss Custome rRestContr oller { | |
| 25 | ||
| 26 | @A utowired | |
| 27 | pr ivate ICus tomerServi ce custome rService; | |
| 28 | ||
| 29 | /* | |
| 30 | @G etMapping( "/api/v1/c ustomers") | |
| 31 | pu blic List< ?> getCust omers() { | |
| 32 | //re turn custo merDAO.lis t(); | |
| 33 | retu rn custome rService.g etList(); | |
| 34 | }* / | |
| 35 | ||
| 36 | @G etMapping( "/api/v1/c ustomers/{ id}") | |
| 37 | pu blic Respo nseEntity< ?> getCust omer(@Path Variable(" id") Long id) { | |
| 38 | ||
| 39 | Cust omer custo mer = cust omerServic e.getCusto mer(id); | |
| 40 | if ( customer = = null) { | |
| 41 | return new Respo nseEntity< >("No Cust omer found for ID " + id, Http Status.NOT _FOUND); | |
| 42 | } | |
| 43 | ||
| 44 | retu rn new Res ponseEntit y<>(custom er, HttpSt atus.OK); | |
| 45 | } | |
| 46 | ||
| 47 | @P ostMapping (value = " /api/v1/cu stomers") | |
| 48 | pu blic Respo nseEntity< ?> createC ustomer(@R equestBody Customer customer) { | |
| 49 | ||
| 50 | Cust omer creat eCustomer = customer Service.cr eateCustom er(custome r); | |
| 51 | if(c reateCusto mer != nul l) { | |
| 52 | return new Respo nseEntity< >(customer , HttpStat us.OK); | |
| 53 | } el se { | |
| 54 | return new Respo nseEntity< >("Error i n creating ", HttpSta tus.BAD_RE QUEST); | |
| 55 | } | |
| 56 | ||
| 57 | } | |
| 58 | ||
| 59 | @D eleteMappi ng("/api/v 1/customer s/{id}") | |
| 60 | pu blic Respo nseEntity< ?> deleteC ustomer(@P athVariabl e Long id) { | |
| 61 | ||
| 62 | if ( null == cu stomerServ ice.delete Customer(i d)) { | |
| 63 | return new Respo nseEntity< >("No Cust omer found for ID " + id, Http Status.NOT _FOUND); | |
| 64 | } | |
| 65 | ||
| 66 | retu rn new Res ponseEntit y<>(id, Ht tpStatus.O K); | |
| 67 | ||
| 68 | } | |
| 69 | ||
| 70 | @P utMapping( "/api/v1/c ustomers/{ id}") | |
| 71 | pu blic Respo nseEntity< ?> updateC ustomer(@P athVariabl e Long id, @RequestB ody Custom er custome r) { | |
| 72 | ||
| 73 | cust omer = cus tomerServi ce.updateC ustomer(id , customer ); | |
| 74 | ||
| 75 | if ( null == cu stomer) { | |
| 76 | return new Respo nseEntity< >("No Cust omer found for ID " + id, Http Status.NOT _FOUND); | |
| 77 | } | |
| 78 | ||
| 79 | retu rn new Res ponseEntit y<>(custom er, HttpSt atus.OK); | |
| 80 | } | |
| 81 | ||
| 82 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.