Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public String getCampaignNames(
}

@CrossOrigin()
@ApiOperation(value = "get login key")
@ApiOperation(value = "Get login key")
@RequestMapping(value = "/getLoginKey", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String getLoginKey(
@ApiParam("{\"username\":\"String: user name\", \"password\":\"String: password\"}") @RequestBody String request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
package com.iemr.common.controller.nhm_dashboard;
package com.iemr.common.controller.nhmdashboard;

import java.util.Arrays;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import com.iemr.common.service.questionconfig.QuestionTypeService;
import com.iemr.common.utils.response.OutputResponse;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@RestController
Expand All @@ -57,14 +58,11 @@ public void setQuestionTypeService(QuestionTypeService questionTypeService) {
this.questionTypeService = questionTypeService;
}

/**
*
* @param request
* @return
*/
@CrossOrigin()
@ApiOperation(value = "Create question type")
@RequestMapping(value = "/put/questionType", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String createQuestionType(@ApiParam(value="{\\\"questionType\\\":\\\"String\\\",\\\"questionTypeDesc\\\":\\\"String\\\"}\"")@RequestBody String request) {
public String createQuestionType(
@ApiParam(value = "{\\\"questionType\\\":\\\"String\\\",\\\"questionTypeDesc\\\":\\\"String\\\"}\"") @RequestBody String request) {
OutputResponse response = new OutputResponse();
try {
response.setResponse(questionTypeService.createQuestionType(request));
Expand All @@ -76,12 +74,8 @@ public String createQuestionType(@ApiParam(value="{\\\"questionType\\\":\\\"Stri
return response.toString();
}

/**
*
* @param request
* @return
*/
@CrossOrigin()
@ApiOperation(value = "Get question type list")
@RequestMapping(value = "/get/questionTypeList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON)
public String questionTypeList() {
OutputResponse response = new OutputResponse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@
import com.iemr.common.service.questionconfig.QuestionnaireService;
import com.iemr.common.utils.response.OutputResponse;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/questionnaireController")
public class QuestionnaireController
{
public class QuestionnaireController {

final Logger logger = LoggerFactory.getLogger(this.getClass().getName());

Expand All @@ -49,49 +50,34 @@ public class QuestionnaireController
/**
* Inject Question Type Repository
*/
public void setQuestionnaireService(QuestionnaireService questionnaireService)
{
public void setQuestionnaireService(QuestionnaireService questionnaireService) {

this.questionnaireService = questionnaireService;
}

/**
*
* @param request
* @return
*/
@CrossOrigin()
@ApiOperation(value = "Create questionnaire")
@RequestMapping(value = "/put/questionnaire", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String createQuestionnaire(@RequestBody String request)
{
public String createQuestionnaire(@RequestBody String request) {
OutputResponse response = new OutputResponse();
try
{
try {
response.setResponse(questionnaireService.createQuestionnaire(request));
} catch (Exception e)
{
} catch (Exception e) {
logger.error("put-questionnaire failed with error " + e.getMessage(), e);
response.setError(e);
}

return response.toString();
}

/**
*
* @param request
* @return
*/
@CrossOrigin()
@ApiOperation(value = "Get questionnaire list")
@RequestMapping(value = "/get/questionnaireList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String questionTypeList()
{
public String questionTypeList() {
OutputResponse response = new OutputResponse();
try
{
try {
response.setResponse(questionnaireService.getQuestionnaireList());
} catch (Exception e)
{
} catch (Exception e) {
logger.error("get-questionnaire failed with error " + e.getMessage(), e);
response.setError(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@

@RequestMapping(value = "/beneficiary")
@RestController
public class SchemeController
{
public class SchemeController {
InputMapper inputMapper = new InputMapper();
private final Logger logger = LoggerFactory.getLogger(this.getClass().getName());

Expand All @@ -54,30 +53,24 @@ public class SchemeController
InputMapper mapper = new InputMapper();

@CrossOrigin
@ApiOperation(value = "stores scheme data", consumes = "application/json", produces = "application/json")
@RequestMapping(
value = "/save/schemeDetails", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE, headers = "Authorization")
public String saveSchemeDetails(
@ApiParam(
value = "{\"providerServiceMapID\": \"integer-provider service map id\", "
+ "\"schemeName\": \"Name of Scheme\", " + "\"schemeDesc\": \"Description of Scheme\", "
+ "\"createdBy\": \"User name of the supervisor creating scheme\", "
+ "\"kmFileManager\":{\"fileName\":\"String: name of file\", " + "\"fileExtension\":\"String: file extension\", "
+ "\"providerServiceMapID\":\"Integer: service provider map ID\", "
+ "\"userID\":\"Integer: user ID of the supervisor\", "
+ "\"fileContent\":\"String: base64encoded binary file content\", "
+ "\"createdBy\":\"String: username of supervisor\"}}") @RequestBody String request)
{
@ApiOperation(value = "Save scheme details", consumes = "application/json", produces = "application/json")
@RequestMapping(value = "/save/schemeDetails", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE, headers = "Authorization")
public String saveSchemeDetails(@ApiParam(value = "{\"providerServiceMapID\": \"integer-provider service map id\", "
+ "\"schemeName\": \"Name of Scheme\", " + "\"schemeDesc\": \"Description of Scheme\", "
+ "\"createdBy\": \"User name of the supervisor creating scheme\", "
+ "\"kmFileManager\":{\"fileName\":\"String: name of file\", "
+ "\"fileExtension\":\"String: file extension\", "
+ "\"providerServiceMapID\":\"Integer: service provider map ID\", "
+ "\"userID\":\"Integer: user ID of the supervisor\", "
+ "\"fileContent\":\"String: base64encoded binary file content\", "
+ "\"createdBy\":\"String: username of supervisor\"}}") @RequestBody String request) {
OutputResponse output = new OutputResponse();
try
{
try {
Scheme scheme = inputMapper.gson().fromJson(request, Scheme.class);
Scheme schemeNew;
schemeNew = schemeServiceImpl.save(scheme);
output.setResponse(schemeNew.toString());
} catch (Exception e)
{
} catch (Exception e) {
logger.error("saveSchemeDetails failed with error " + e.getMessage(), e);
output.setError(e);
}
Expand All @@ -86,28 +79,23 @@ public String saveSchemeDetails(
}

@CrossOrigin
@RequestMapping(
value = "/get/schemeList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE, headers = "Authorization")
public String getSchemeList(@ApiParam(value = "{\"providerServiceMapID\":\"Integer\"}") @RequestBody String createRequest)
{
@ApiOperation(value = "Get scheme list")
@RequestMapping(value = "/get/schemeList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE, headers = "Authorization")
public String getSchemeList(
@ApiParam(value = "{\"providerServiceMapID\":\"Integer\"}") @RequestBody String createRequest) {
logger.info("getSchemeList request " + createRequest);
OutputResponse output = new OutputResponse();
try
{
try {
Scheme m_scheme = mapper.gson().fromJson(createRequest, Scheme.class);
List<Scheme> schemes = null;
schemes = schemeServiceImpl.getSchemeList(m_scheme.getProviderServiceMapID());
if (schemes != null)
{
if (schemes != null) {
output.setResponse(schemes.toString());
} else
{
} else {
output.setError(5000, "No schemes available");
}

} catch (Exception e)
{
} catch (Exception e) {
logger.error("getSchemeList failed with error " + e.getMessage(), e);
output.setError(e);
}
Expand All @@ -116,27 +104,24 @@ public String getSchemeList(@ApiParam(value = "{\"providerServiceMapID\":\"Integ
}

@CrossOrigin
@RequestMapping(value = "/scheme/deleteScheme", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes=MediaType.APPLICATION_JSON_VALUE, headers = "Authorization")
public String deleteScheme(@ApiParam(value = "{\"schemeID\":\"Integer\",\"deleted\":\"Boolean\"}") @RequestBody String createRequest)
{
@ApiOperation(value = "Delete scheme")
@RequestMapping(value = "/scheme/deleteScheme", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE, headers = "Authorization")
public String deleteScheme(
@ApiParam(value = "{\"schemeID\":\"Integer\",\"deleted\":\"Boolean\"}") @RequestBody String createRequest) {
logger.info("delete scheme request " + createRequest);
OutputResponse output = new OutputResponse();
try
{
try {
Scheme m_scheme = mapper.gson().fromJson(createRequest, Scheme.class);
Scheme scheme = null;
scheme = schemeServiceImpl.getSchemeByID(m_scheme.getSchemeID());
if (scheme != null)
{
if (scheme != null) {
scheme.setDeleted(m_scheme.getDeleted());
output.setResponse(schemeServiceImpl.deletedata(scheme));
} else
{
} else {
output.setError(5000, "No schemes available");
}

} catch (Exception e)
{
} catch (Exception e) {
logger.error("getSchemeList failed with error " + e.getMessage(), e);
output.setError(e);
}
Expand Down
Loading