package com.sa.ibiz.demo.mob.controller;

import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sa.ibiz.demo.ibizutil.domain.ActionResult;
import com.sa.ibiz.demo.ibizutil.domain.CodeList;
import com.sa.ibiz.demo.ibizutil.errors.BadRequestAlertException;
import org.springframework.validation.annotation.Validated;
import org.springframework.http.ResponseEntity;

@RestController
@RequestMapping("/mob/app/codelist")
public class MobCodeListController{

	@Resource(name="ionicdemo_QJSPStateCodeList")
	private com.sa.ibiz.demo.demo.codelist.QJSPStateCodeList ionicdemo_QJSPStateCodeList;


	@Resource(name="ionicdemo_YesNoCodeList")
	private com.sa.ibiz.demo.demo.codelist.YesNoCodeList ionicdemo_YesNoCodeList;


	@Resource(name="ionicdemo_CodeList81CodeList")
	private com.sa.ibiz.demo.demo.codelist.CodeList81CodeList ionicdemo_CodeList81CodeList;



	@RequestMapping("ionicdemo/qjspstate")
    public ResponseEntity<CodeList> getionicdemo_QJSPStateCodeList(){
    	return ResponseEntity.ok().body(ionicdemo_QJSPStateCodeList.getCodeList());
	}
	@RequestMapping("ionicdemo/yesno")
    public ResponseEntity<CodeList> getionicdemo_YesNoCodeList(){
    	return ResponseEntity.ok().body(ionicdemo_YesNoCodeList.getCodeList());
	}
	@RequestMapping("ionicdemo/codelist81")
    public ResponseEntity<CodeList> getionicdemo_CodeList81CodeList(){
    	return ResponseEntity.ok().body(ionicdemo_CodeList81CodeList.getCodeList());
	}

	@RequestMapping("getall")
    public ResponseEntity<List<CodeList>> getAll(){
     List<CodeList> list = new ArrayList<CodeList>();
    list.add(ionicdemo_QJSPStateCodeList.getCodeList());
    list.add(ionicdemo_YesNoCodeList.getCodeList());
    list.add(ionicdemo_CodeList81CodeList.getCodeList());
    	return ResponseEntity.ok().body(list);
	}
}