package cn.autoform.web.controller.businesscategoryedit; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import cn.autoform.bean.BusinessCategoryCusEntity; import cn.autoform.fw.exception.RestResult; import cn.autoform.fw.utility.RestResultGenerator; import cn.autoform.web.service.businesscategoryedit.BusinessCategoryEditService; /** * @author lt-wx * 业务功能分类编辑Controller */ @RestController public class BusinessCategoryEditController { @Autowired private BusinessCategoryEditService businessCategoryEditService = null; /** * @param businessCategoryID * 业务分类ID * @return * 业务分类 */ @RequestMapping(value = "${requset.businessCategoryEdit01}", method = RequestMethod.GET) public RestResult getBusinessCategoryService(String businessCategoryID,String tenantID){ BusinessCategoryCusEntity rsList = businessCategoryEditService.getBusinessCategoryInfo(businessCategoryID,tenantID); return RestResultGenerator.genSuccessResult(rsList); } /** * 新增一条业务分类 * @param businessCategory * @return */ @RequestMapping(value = "${requset.businessCategoryEdit02}", method = RequestMethod.POST) public RestResult createBusinessCategoryService(@RequestBody BusinessCategoryCusEntity businessCategory){ int nRs = businessCategoryEditService.createBusinessCategory(businessCategory); return RestResultGenerator.genSuccessResult(String.valueOf(nRs)); } /** * 编辑一条业务分类 * @param businessCategory * @return */ @RequestMapping(value = "${requset.businessCategoryEdit03}", method = RequestMethod.POST) public RestResult saveBusinessCategoryService(@RequestBody BusinessCategoryCusEntity businessCategory){ int nRs = businessCategoryEditService.saveBusinessCategory(businessCategory); return RestResultGenerator.genSuccessResult(String.valueOf(nRs)); } /** * check业务分类名称唯一 * @param businessCategory * @return */ @RequestMapping(value = "${requset.businessCategoryEdit04}", method = RequestMethod.POST) public RestResult checkBusinessCategoryNameService(@RequestBody BusinessCategoryCusEntity businessCategory){ int nRs = businessCategoryEditService.checkBusinessCategoryName(businessCategory); return RestResultGenerator.genSuccessResult(String.valueOf(nRs)); } }