Skip to content

Commit

Permalink
Add HttpHeaders
Browse files Browse the repository at this point in the history
  • Loading branch information
jichaofdu committed Oct 13, 2018
1 parent 13139b0 commit b075e85
Show file tree
Hide file tree
Showing 136 changed files with 3,472 additions and 2,041 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import adminbasic.domin.reuslt.*;
import adminbasic.service.AdminBasicInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;

@RestController
Expand All @@ -17,152 +18,152 @@ public class AdminBasicInfoController {
AdminBasicInfoService adminBasicInfoService;

@RequestMapping(path = "/welcome", method = RequestMethod.GET)
public String home() {
public String home(@RequestHeader HttpHeaders headers) {
return "Welcome to [ AdminBasicInfo Service ] !";
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/getAllContacts/{id}", method = RequestMethod.GET)
public GetAllContactsResult getAllContacts(@PathVariable String id){
public GetAllContactsResult getAllContacts(@PathVariable String id, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Find All Contacts by admin: " + id);
return adminBasicInfoService.getAllContacts(id);
return adminBasicInfoService.getAllContacts(id, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/deleteContacts", method = RequestMethod.POST)
public DeleteContactsResult deleteContacts(@RequestBody DeleteContactsInfo dci){
public DeleteContactsResult deleteContacts(@RequestBody DeleteContactsInfo dci, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Delete Contacts by admin: " + dci.getLoginId());
return adminBasicInfoService.deleteContact(dci.getLoginId(), dci);
return adminBasicInfoService.deleteContact(dci.getLoginId(), dci, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/modifyContacts", method = RequestMethod.POST)
public ModifyContactsResult modifyContacts(@RequestBody ModifyContactsInfo mci){
public ModifyContactsResult modifyContacts(@RequestBody ModifyContactsInfo mci, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Modify Contacts by admin: " + mci.getLoginId());
return adminBasicInfoService.modifyContact(mci.getLoginId(), mci);
return adminBasicInfoService.modifyContact(mci.getLoginId(), mci, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/addContacts", method = RequestMethod.POST)
public AddContactsResult addContacts(@RequestBody Contacts c){
public AddContactsResult addContacts(@RequestBody Contacts c, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Modify Contacts by admin: " + c.getLoginId());
return adminBasicInfoService.addContact(c.getLoginId(), c);
return adminBasicInfoService.addContact(c.getLoginId(), c, headers);
}

/////////////////////////station/////////////////////////////////////////////////////////////////////////////////
@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/getAllStations/{id}", method = RequestMethod.GET)
public GetAllStationResult getAllStations(@PathVariable String id){
public GetAllStationResult getAllStations(@PathVariable String id, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Find All Station by admin: " + id);
return adminBasicInfoService.getAllStations(id);
return adminBasicInfoService.getAllStations(id, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/deleteStation", method = RequestMethod.POST)
public boolean deleteStation(@RequestBody Station s){
public boolean deleteStation(@RequestBody Station s, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Delete Station by admin: " + s.getLoginId());
return adminBasicInfoService.deleteStation(s);
return adminBasicInfoService.deleteStation(s, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/modifyStation", method = RequestMethod.POST)
public boolean modifyStation(@RequestBody Station s){
public boolean modifyStation(@RequestBody Station s, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Modify Station by admin: " + s.getLoginId());
return adminBasicInfoService.modifyStation(s);
return adminBasicInfoService.modifyStation(s, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/addStation", method = RequestMethod.POST)
public boolean addStation(@RequestBody Station s){
public boolean addStation(@RequestBody Station s, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Modify Station by admin: " + s.getLoginId());
return adminBasicInfoService.addStation(s);
return adminBasicInfoService.addStation(s, headers);
}

/////////////////////////train/////////////////////////////////////////////////////////////////////////////////
@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/getAllTrains/{id}", method = RequestMethod.GET)
public GetAllTrainResult getAllTrains(@PathVariable String id){
public GetAllTrainResult getAllTrains(@PathVariable String id, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Find All Train by admin: " + id);
return adminBasicInfoService.getAllTrains(id);
return adminBasicInfoService.getAllTrains(id, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/deleteTrain", method = RequestMethod.POST)
public boolean deleteTrain(@RequestBody TrainInfo2 t){
public boolean deleteTrain(@RequestBody TrainInfo2 t, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Delete Train by admin: " + t.getLoginId());
return adminBasicInfoService.deleteTrain(t);
return adminBasicInfoService.deleteTrain(t, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/modifyTrain", method = RequestMethod.POST)
public boolean modifyTrain(@RequestBody TrainType t){
public boolean modifyTrain(@RequestBody TrainType t, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Modify Train by admin: " + t.getLoginId());
return adminBasicInfoService.modifyTrain(t);
return adminBasicInfoService.modifyTrain(t, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/addTrain", method = RequestMethod.POST)
public boolean addTrain(@RequestBody TrainType t){
public boolean addTrain(@RequestBody TrainType t, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Modify Train by admin: " + t.getLoginId());
return adminBasicInfoService.addTrain(t);
return adminBasicInfoService.addTrain(t, headers);
}

/////////////////////////config/////////////////////////////////////////////////////////////////////////////////
@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/getAllConfigs/{id}", method = RequestMethod.GET)
public GetAllConfigResult getAllConfigs(@PathVariable String id){
public GetAllConfigResult getAllConfigs(@PathVariable String id, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Find All Config by admin: " + id);
return adminBasicInfoService.getAllConfigs(id);
return adminBasicInfoService.getAllConfigs(id, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/deleteConfig", method = RequestMethod.POST)
public String deleteConfig(@RequestBody ConfigInfo2 c){
public String deleteConfig(@RequestBody ConfigInfo2 c, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Delete Config by admin: " + c.getLoginId());
return adminBasicInfoService.deleteConfig(c);
return adminBasicInfoService.deleteConfig(c, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/modifyConfig", method = RequestMethod.POST)
public String modifyConfig(@RequestBody Config c){
public String modifyConfig(@RequestBody Config c, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Modify Config by admin: " + c.getLoginId());
return adminBasicInfoService.modifyConfig(c);
return adminBasicInfoService.modifyConfig(c, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/addConfig", method = RequestMethod.POST)
public String addConfig(@RequestBody Config c){
public String addConfig(@RequestBody Config c, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Modify Config by admin: " + c.getLoginId());
return adminBasicInfoService.addConfig(c);
return adminBasicInfoService.addConfig(c, headers);
}

/////////////////////////price/////////////////////////////////////////////////////////////////////////////////
@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/getAllPrices/{id}", method = RequestMethod.GET)
public GetAllPriceResult getAllPrices(@PathVariable String id){
public GetAllPriceResult getAllPrices(@PathVariable String id, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Find All Price by admin: " + id);
return adminBasicInfoService.getAllPrices(id);
return adminBasicInfoService.getAllPrices(id, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/deletePrice", method = RequestMethod.POST)
public boolean deletePrice(@RequestBody PriceInfo pi){
public boolean deletePrice(@RequestBody PriceInfo pi, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Delete Price by admin: " + pi.getLoginId());
return adminBasicInfoService.deletePrice(pi);
return adminBasicInfoService.deletePrice(pi, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/modifyPrice", method = RequestMethod.POST)
public boolean modifyPrice(@RequestBody PriceInfo pi){
public boolean modifyPrice(@RequestBody PriceInfo pi, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Modify Price by admin: " + pi.getLoginId());
return adminBasicInfoService.modifyPrice(pi);
return adminBasicInfoService.modifyPrice(pi, headers);
}

@CrossOrigin(origins = "*")
@RequestMapping(path = "/adminbasic/addPrice", method = RequestMethod.POST)
public ReturnSinglePriceConfigResult addPrice(@RequestBody PriceInfo pi){
public ReturnSinglePriceConfigResult addPrice(@RequestBody PriceInfo pi, @RequestHeader HttpHeaders headers){
System.out.println("[Admin Basic Info Service][Add Price by admin: " + pi.getLoginId());
return adminBasicInfoService.addPrice(pi);
return adminBasicInfoService.addPrice(pi, headers);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,54 @@
import adminbasic.domin.bean.TrainType;
import adminbasic.domin.info.*;
import adminbasic.domin.reuslt.*;
import org.springframework.http.HttpHeaders;

public interface AdminBasicInfoService {

////////////contact/////////////////////////////////////////
GetAllContactsResult getAllContacts(String loginId);
GetAllContactsResult getAllContacts(String loginId, HttpHeaders headers);

AddContactsResult addContact(String loginId, Contacts c);
AddContactsResult addContact(String loginId, Contacts c, HttpHeaders headers);

DeleteContactsResult deleteContact(String loginId, DeleteContactsInfo dci);
DeleteContactsResult deleteContact(String loginId, DeleteContactsInfo dci, HttpHeaders headers);

ModifyContactsResult modifyContact(String loginId, ModifyContactsInfo mci);
ModifyContactsResult modifyContact(String loginId, ModifyContactsInfo mci, HttpHeaders headers);

////////////////////////////station///////////////////////////////
GetAllStationResult getAllStations(String loginId);
GetAllStationResult getAllStations(String loginId, HttpHeaders headers);

boolean addStation(Station s);
boolean addStation(Station s, HttpHeaders headers);

boolean deleteStation( Station s);
boolean deleteStation( Station s, HttpHeaders headers);

boolean modifyStation( Station s);
boolean modifyStation( Station s, HttpHeaders headers);

////////////////////////////train///////////////////////////////
GetAllTrainResult getAllTrains(String loginId);
GetAllTrainResult getAllTrains(String loginId, HttpHeaders headers);

boolean addTrain(TrainType t);
boolean addTrain(TrainType t, HttpHeaders headers);

boolean deleteTrain(TrainInfo2 t);
boolean deleteTrain(TrainInfo2 t, HttpHeaders headers);

boolean modifyTrain( TrainType t);
boolean modifyTrain( TrainType t, HttpHeaders headers);

////////////////////////////config///////////////////////////////
GetAllConfigResult getAllConfigs(String loginId);
GetAllConfigResult getAllConfigs(String loginId, HttpHeaders headers);

String addConfig(Config c);
String addConfig(Config c, HttpHeaders headers);

String deleteConfig(ConfigInfo2 ci);
String deleteConfig(ConfigInfo2 ci, HttpHeaders headers);

String modifyConfig( Config c);
String modifyConfig( Config c, HttpHeaders headers);

////////////////////////////price///////////////////////////////
GetAllPriceResult getAllPrices(String loginId);
GetAllPriceResult getAllPrices(String loginId, HttpHeaders headers);

ReturnSinglePriceConfigResult addPrice(PriceInfo pi);
ReturnSinglePriceConfigResult addPrice(PriceInfo pi, HttpHeaders headers);

boolean deletePrice(PriceInfo pi);
boolean deletePrice(PriceInfo pi, HttpHeaders headers);

boolean modifyPrice(PriceInfo pi);
boolean modifyPrice(PriceInfo pi, HttpHeaders headers);

// Contacts login(String name, String password);

Expand Down
Loading

0 comments on commit b075e85

Please sign in to comment.